niche Posted June 22, 2012 Share Posted June 22, 2012 (edited) Ebay's sort function feels like JS, but I can't find their sort by options on Firebug. What do you think? Edited June 23, 2012 by niche Link to comment Share on other sites More sharing options...
dsonesuk Posted June 23, 2012 Share Posted June 23, 2012 unobtrusive jquery, which kept separate from html, and applied to the element upon loading of page, see js version below window.onload = function(){x=document.getElementById("select02");x.onchange=function(){dothis(this)}}function dothis(elem){alert("This option selected from select list with id ref "+elem.id+" is "+elem.value)} <select id="select01" onchange="dothis(this);"><option value="option01"> option01</option><option value="option02"> option02</option><option value="option03"> option03</option></select><select id="select02"><option value="option01"> option01</option><option value="option02"> option02</option><option value="option03"> option03</option></select> Even though you cannot see it as you can the inline onchange, it does apply and onchange event to the element which will call the same function with identification argument of 'this' of which html object this call relates to Link to comment Share on other sites More sharing options...
niche Posted June 23, 2012 Author Share Posted June 23, 2012 (edited) Thanks donesuk. I've never used jquery, but I know javascript. Your post looks like an excellent opportunity to familiarize myself with jq. So, before I continue I'll do the tutorials and start a new topic when I have questions. Thanks again for the entree. Edited June 23, 2012 by niche Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now