jQuery custom selection -
i'd extend jquery selection treats given selection value id.
for example, when $("foo.bar")
, jquery try select elements tag name foo , class bar, want jquery select element id of foo.bar
. instead of having escape dots , prepend #
each time, i'd add jquery function can $("id:foo.bar")
.
is possible jquery? if so, can show me examples?
thanks.
if replace id selection attribute filter, have test every element on page id instead of using document.getelementbyid
.
if want little more convenience, create own wrapper. can use jquery's namespace if want:
jquery.byid = function(id){return $(document.getelementbyid(id));}; $.byid('foo.bar').addclass('something');
Comments
Post a Comment