Wednesday, 15 June 2011

javascript - onclick alert for html pages not popping up -



javascript - onclick alert for html pages not popping up -

how ensure alert popup show when link clicked?

<a href="#" onclick="alert('test');" class="button4" style="margin-top: 10px; font-family: robotoreg;width: 100%;background:#b3c833;">click <br /><b>here</b> now!</a>

the above code works if come in :

<a href="#" onclick="alert('congratulations\nyou have completed quiz!\nclick next play more games');" class="button4" style="margin-top: 10px; font-family: robotoreg;width: 100%;background:#b3c833;"></a>

the alert popup doesnt show up.

any ideas why? thanks

here, utilize both of ur example

jsfiddle.net/9hk6kcuo/

it works. 2nd ex not works 'cause have ' in js code (you 're). split ur code 2

javascript html html5

No comments:

Post a Comment