Autor Zpráva
macomart
Profil
Nastavenie udalosti
macomart
Profil
Skusal som nastavit udalost pomocou js, ale neadri sa mi:

<html>
<head>
<script>
function Start() {
document.getElementById('box').setAttribute("onClick", "alert()");
}
</script>
</head>
<body onLoad="Start();">
<div id="box">text</div>
</body>
</html>

mozete sa na to prosim pozriet, dakujem.
Hooonza
Profil *
<html>
<head> </head> <body>
<div onclick="alert('ahoj');">text</div>
</body>
</html>
macomart
Profil
Tento sposob poznam ale ja by som to chcel cez javascript.
Hooonza
Profil *
onclick="alert('ahoj');" JE javaskript.
Hooonza
Profil *
Pokud chceš s událostí pracovat, našel jsem třeba něco takového:

<html>
<head> </head>
<body>
<span id="text1">text</span>

<script>
document.getElementById('text1').onclick = function() {alert('ahoj')};
</script>

</body>
</html>


Více http://interval.cz/clanky/programujeme-dhtml-aplikace-interakce-s-uziv atelem/ , http://www.webtip.cz/art/wt_tech_dhtml/dhtml_006.html
macomart
Profil
Dakujem, asi takyto sposob som chcel.
Toto téma je uzamčeno. Odpověď nelze zaslat.

0