joecool2005 Posted October 15, 2009 Share Posted October 15, 2009 Hi,Why the "onclick" in <select> tag does not work in Safari? <html><body><select onclick ="alert("test");"> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option></select> </body></html> Thx Link to comment Share on other sites More sharing options...
Ingolme Posted October 15, 2009 Share Posted October 15, 2009 The <select> element probably doesn't have a click event, try onchange instead. Link to comment Share on other sites More sharing options...
chibineku Posted October 15, 2009 Share Posted October 15, 2009 Does it work in other browsers?There is a mismatch of parentheses going on. Try: onclick='alert("test")';Note the quotes, and also the semi-colon outside the quotes. Link to comment Share on other sites More sharing options...
joecool2005 Posted October 15, 2009 Author Share Posted October 15, 2009 I want to store the first value before the select box is changed Link to comment Share on other sites More sharing options...
chibineku Posted October 15, 2009 Share Posted October 15, 2009 If you always store the value onchange to the end of an array, you will always be able to fetch the previous value, and you know what value it starts as, so you would be able to find anything you wanted. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2009 Share Posted October 15, 2009 That semicolon actually needs to go inside the qutoes, BTW. The semicolon is part of the Javascript, not the HTML. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.