9
rated 0 times
[
15]
[
6]
/ answers: 1 / hits: 99457
/ 13 Years ago, thu, may 19, 2011, 12:00:00
document.getElementById(...).setAttribute('style',... is not working in Internet Explorer 7.0. How can I make this work in Internet Explorer?
<!DOCTYPE html>
<html lang=en>
<head>
<script type=text/javascript>
var myarray=new Array(3);
for (i=0; i <1000; i++){
myarray[i]=new Array(3);
}
myarray[0][0]=new; myarray[0][1]=old;
function swapText(id){
document.getElementById('id' + id).setAttribute('style', 'font-weight: bold; color: red; font-size:150%;');
document.getElementById('id'+ id).innerHTML = myarray[id][0];
}
function originalText(id){
document.getElementById('id' + id).setAttribute('style', 'color:' + 'black' + ';');
document.getElementById('id' + id).innerHTML = myarray[id][1];
}
</script>
</head>
<body>
<div id=scoreboard border='1'> </div>
<div id=qa>
<div id=col1 class=column>
<div id=id0 onmouseover=swapText(0); onmouseout=originalText(0)>old</div>
</div>
</div>
</body>
</html>
More From » javascript