jQuery access input hidden value

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

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

9条回答
  •  抹茶落季
    2020-11-28 02:45

    The most efficient way is by ID.

    $("#foo").val(); //by id
    

    You can read more here:

    https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Writing_efficient_CSS

    https://developers.google.com/speed/docs/best-practices/rendering?hl=it#UseEfficientCSSSelectors

提交回复
热议问题