|
|
|
| Менял аткрибуты по :
obj.setAttribute(sAttribute,new Function(sValue));
obj.setAttribute(sAttribute,sValue);
|
НО!
Не везде и всегда работает! Как отладить наверняка сменяющий код...
В ie/opera/mo? | |
|
|
|
|
|
|
|
для: Bernex
(11.06.2006 в 12:11)
| | Попробуй чтоли так (у меня в опера 8.53 и IE работает)
<html>
<head>
<script>
function f()
{
var znch = 'работает';
var myobj = document.getElementById('MyBut');
myobj.setAttribute('onclick','ff("'+znch+'")')
if(typeof myobj.onclick == 'string')
{
// для IE
myobj.setAttribute('onclick',function(){ff(znch)})
}
}
function ff(x)
{
alert(x);
}
</script>
</head>
<body onload="f()">
<button id="MyBut">кнопка</button>
</body>
</html>
|
| |
|
|
|