Get default value of an input using jQuery

前端 未结 6 1048
梦谈多话
梦谈多话 2021-01-04 00:53
$(\".box_yazi2\").each(function () {
    var default_value = this.value;
    $(this).css(\'color\', \'#555\'); // this could be in the style sheet instead
    $(this         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-04 01:45

    Use this.defaultValue

    Sorry for the link to w3notcools, http://www.w3schools.com/jsref/prop_text_defaultvalue.asp

提交回复
热议问题