Hi all, I would like to ask you for help, I’m generally of the paralytic in JavaScript, a little know how other programming languages​​, I wrote something like this up and running, (happily):
[code] function czerwony(wskaznik)
{
document.getElementById(wskaznik).style.color=’#FF0000′;
}
function czarny(wskaznik)
{
document.getElementById(wskaznik).style.color=’#000000′;
}
//use:
<p id=’akapit’ onmouseover=”czerwony(‘akapit’)” onmouseout=”czarny(‘akapit’)” >blablablablablablablabla</p>
but if someone could help me write something with this? something like that:
[code]
function czerwony(wskaznik)
{
wskaznik.style.color=’#FF0000′;
}
function czarny(wskaznik)
{
wskaznik.style.color=’#000000′;
}
//use:
<p onmouseover=”czerwony(‘this’)” onmouseout=”czarny(‘this’)” >blablablablablablablabla</p>
and ideally should work as:
[code] function czerwony()
{
this.style.color=’#FF0000′;
}
function czarny()
{
this.style.color=’#000000′;
}
//użycie:
<p onmouseover=”czerwony()” onmouseout=”czarny()” >blablablablablablablabla</p>
Tell me, you can do something like that, or not much? and used this as the last code tag does not indicate (object) who called the function? or from the body of the function is a simple pointer to the object that caused it, or just look like in the first code? Is it possible to pass a pointer to an object by the argument of the function (as in the second example)?