Jump to content

onChange Event


Craig Hopson

Recommended Posts

hi guys can someone tell me where im going wrong please

<!DOCTYPE html><html><head><script>function test() {    alert(menu1.value);}</script></head><body><select name="menu" onchange="test(menu.value);">    <option value="1">1</option>    <option value="5">5</option>    <option value="10">10</option></select></body></html>

Edited by Craig Hopson
Link to comment
Share on other sites

<!DOCTYPE html><html><head><script>function test(optvalue) {    alert(optvalue);}</script></head><body><select name="menu" onchange="test(this.value);">    <option value="1">1</option>    <option value="5">5</option>    <option value="10">10</option></select></body></html>

  • Like 1
Link to comment
Share on other sites

can this be done?

<!DOCTYPE html><html><head><script>var seconds = 1000; function test(optvalue) {   var seconds = optvalue;   alert(optvalue); } window.setInterval(function(){  var d=new Date();document.getElementById("output").innerHTML = d;  }, seconds);</script></head><body><select name="menu" onchange="test(this.value);">	<option value="1">1</option>	<option value="5">5</option>	<option value="10">10</option></select><div id="output"></div></body></html>

Edited by Craig Hopson
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...