Quick, but not dirty MorningZ!  Good code :-)

Annotation:
 $(document).ready(function() {
 // DOM is ready:

            // when we click on a checkbox
            $(":checkbox").click(function() {
            // find the next element and take the text of it.
                alert($(this).next().text());
            });

    });

The "next element" in this case is the text node.
<label><input type="checkbox " />hello</label>

In this case 'hello'.

You could just as easily assign the value to a variable instead of
alert()ing it:
var my_var = $(this).next().text();


On Sep 25, 3:47 pm, MorningZ <[EMAIL PROTECTED]> wrote:
> Here's some quick and dirty (and working) code
>
> http://paste.pocoo.org/show/86213/

Reply via email to