views:

12

answers:

1

Hi all i have the html as follows

<div class="element-container" id="div_3">
    <div id="submit_submit" class="element">
        <div class="fleft">
            <input type="submit" value="Click me!" name="submit" id="submit"/>
        </div>
        <div class="clr"/>
    </div>
</div>

When i click on element-container i want the label of submit button ie Click me!

Pls give a solution , I've tried $('#submit').attr('value'). but i didn't get the result

+1  A: 

There's a built-in method in jQuery for returning the value of INPUT elements, val(). The following should work:

$('#submit').val();

I've never tried it with a submit button specifically though.

Ryan Brunner
i think it didn't get because of id, name have the value submit . Is it a reserved word ?
Nisanth