![]() |
Execute a function when selected - javascript How can achieve this. For example on this code: Code: <select name="">Please advise.. Thanks |
Re: Execute a function when selected - javascript Give the select object and id and in your javascript add something like: var dothis = function(){ return function(e){ var s = document.getElementById('yourId'); if(s.options[s.selectedIndex]=='test2'){ // YOUR CODE HERE } } } document.getElementById('yourId').onchange = dothis(); |
Re: Execute a function when selected - javascript Hi kdavies thanks! How can I execute that function if any value on the list is selected? |
Re: Execute a function when selected - javascript Here's another way to do it... Code: <!-- Javascript --> |
Re: Execute a function when selected - javascript And if you want to use jQuery.. Code: <script type="text/javascript"> |
| All times are GMT -6. The time now is 06:48 AM. |