jQuery access input hidden value

前端 未结 9 1862
执念已碎
执念已碎 2020-11-28 01:50

How can I access tag\'s value attribute using jQuery?

9条回答
  •  独厮守ぢ
    2020-11-28 02:44

    There's a jQuery selector for that:

    // Get all form fields that are hidden
    var hidden_fields = $( this ).find( 'input:hidden' );
    
    // Filter those which have a specific type
    hidden_fields.attr( 'text' );
    

    Will give you all hidden input fields and filter by those with a specific type="".

提交回复
热议问题