You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
778 B
JavaScript
26 lines
778 B
JavaScript
5 years ago
|
//First create a list of all bold items
|
||
|
var bold_Items;
|
||
|
window.onload = getBold_items();
|
||
|
|
||
|
// Collect all <strong> tags
|
||
|
function getBold_items()
|
||
|
{
|
||
|
bold_Items = document.getElementsByTagName('strong');
|
||
|
}
|
||
|
// iterate all bold tags and change color
|
||
|
function highlight()
|
||
|
{
|
||
|
for (var i=0; i<bold_Items.length; i++)
|
||
|
{
|
||
|
bold_Items[i].style.color = "green";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// On mouse out highlighted words become black
|
||
|
function return_normal()
|
||
|
{
|
||
|
for (var i=0; i<bold_Items.length; i++)
|
||
|
{
|
||
|
bold_Items[i].style.color = "black";
|
||
|
}
|
||
|
}
|