[jQuery] Re: JQuery css selector

2009-05-18 Thread Peter Edwards
Take a look at this example: http://bjorsq.net/selector.html on 18/05/2009 11:07 ocptime said:: Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards wrote: $('#delete_item a').click(function(){ return (confirm

[jQuery] Re: JQuery css selector

2009-05-18 Thread ryan.j
$(function() { $("ul li").click(function () { alert("clicky, innit."); }); }); maybe take a look through the jquery tutorials here -> http://docs.jquery.com/Tutorials On May 18, 11:07 am, ocptime wrote: > Hi, > > It's not working :). > How can i select using the jquery ul li selector?

[jQuery] Re: JQuery css selector

2009-05-18 Thread ryan.j
are you initiating the click()? $(function() { $("ul li").click(function () { alert("clicky, innit."); }); }); On May 18, 10:58 am, ocptime wrote: > Hi, > > It's not working :). > How can i select using the jquery ul li s

[jQuery] Re: JQuery css selector

2009-05-18 Thread ocptime
Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards wrote: >   $('#delete_item a').click(function(){ >     return (confirm('Are you sure?')); >   }); > > This will only work if there is one item to delete on the page because

[jQuery] Re: JQuery css selector

2009-05-18 Thread ocptime
Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards wrote: >   $('#delete_item a').click(function(){ >     return (confirm('Are you sure?')); >   }); > > This will only work if there is one item to delete on the page because

[jQuery] Re: JQuery css selector

2009-05-18 Thread ryan.j
$('ul li').click(function(){ /* ... stuff ... */ }); will bind code to the click event on all ul li elements in the document, but you'll probably want to pass it some kind of unique identifier otherwise you may end up triggering the code when you don't want to since all li would trigger the s

[jQuery] Re: JQuery css selector

2009-05-18 Thread ryan.j
$('ul li').click(function(){ /* ... stuff ... */ }); will bind soem code to the click event on all ul li elements, but you'll probably want to pass it some kind of unique identifier otherwise you'll get screwy results and be unable to do anything meaningful with the function. On May 18, 10:3

[jQuery] Re: JQuery css selector

2009-05-18 Thread ocptime
Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards wrote: >   $('#delete_item a').click(function(){ >     return (confirm('Are you sure?')); >   }); > > This will only work if there is one item to delete on the page because

[jQuery] Re: JQuery css selector

2009-05-18 Thread ocptime
Hi, It's not working :). How can i select using the jquery ul li selector? Thanks ocptime On 18 May, 13:39, Peter Edwards wrote: >   $('#delete_item a').click(function(){ >     return (confirm('Are you sure?')); >   }); > > This will only work if there is one item to delete on the page because

[jQuery] Re: JQuery css selector

2009-05-18 Thread Peter Edwards
$('#delete_item a').click(function(){ return (confirm('Are you sure?')); }); This will only work if there is one item to delete on the page because it uses an ID selector. If you have multiple items, use a class selector instead. on 18/05/2009 08:43 ocptime said:: > Hi everyone, > > How