Grab the name of an element with jquery

Here is a example without knowing more of your code:

$(function () {
    $('input:checkbox').click(function () {
        $(this).prop('disabled', true);
        var iName =;
            url: "file.php",
            data: {
                'inputname': iName
            success: function (data) {

Demo here

If you want to reach the input via name directly you need to use double backslasshes to escape the square brackets and reach that input via name. Use:


Leave a Comment