<input type="text" name="mytext" id="mytext" data-custom="custom value"/>
get the value of attribute:
var defaultData = $('#mytext').attr('value');
set the value of attribute:
var defaultData = $('#mytext').attr('value','love');
or
var defaultData = $('#mytext').attr({'value':'love','title':'my title','disabled':true});
get the value of attribute:
var defaultData = $('#mytext').attr('value');
set the value of attribute:
var defaultData = $('#mytext').attr('value','love');
or
var defaultData = $('#mytext').attr({'value':'love','title':'my title','disabled':true});
Comments
Post a Comment