Jump to content

How do you think ebay does it? Solved with thanks in the final post.


niche

Recommended Posts

Ebay's sort function feels like JS, but I can't find their sort by options on Firebug. What do you think?

Edited by niche
Link to comment
Share on other sites

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

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 by niche
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...