javascript - document.getElementById(fieldName).value; is not working in chrome and firefox -
following javascript in html working in ie browser. but, when execute in chrome , firefox browser not working.
var lastname = getvalueoffield("txtname"); function getvalueoffield(fieldname) { return document.getelementbyid(fieldname).value; }
please me.
it working fine...
<input type="text" id="txtname" value="testdata"> var lastname = getvalueoffield("txtname"); function getvalueoffield(fieldname) { console.log(document.getelementbyid(fieldname).value) return document.getelementbyid(fieldname).value; }
Comments
Post a Comment