Click to See Complete Forum and Search --> : javascript in <DIV> tags


fulla_flava
05-07-2003, 08:49 AM
im having trouble putting the java script for opening new windows inside div tags. is there any way possible for this to work or is it somthing to do with the hosting im using, im using yahoo, page builder but when i put the javascript in the div tags it just coems up with an error. ne help would eb appriciated. thanks

cmelnick
05-07-2003, 09:03 AM
This shouldn't be dependent on host or provider since it is all client side.

Try this:


<div style="width: 250; height: 30; cursor: hand; text-align: center; border: 1px solid black;"
onClick="javascript:openWin();">
Click To Open Window</div>

<script language="Javascript"><!--
function openWin() {
alert ("code for opening window should go here.");
}
//--></script>