Hello,

That's a noob question... Thanks for helping

Inside a function in a script, I'm trying to get the value of a button when 
clicked.
I just can't figure out the usage of "this" in that case.
There are a certain number of buttons in the page and several functions 
attached to them so I don't want to do jQuery('.A1').val() in the fuction 
each time a button is clicked. 
I want the function to detect which button is clicked and its value

<script>
jQuery(document).ready(function(){
    $.fn.dosomething = function(){
        var currentval = $(this).val();
        console.log(currentval);
};
});
</script>

<INPUT type="button" class="A1" value="blabla" onclick="jQuery().dosomething
()"/>

Thanks a lot for any help

Dominique

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to