Html Input - Getting The Value Via Innerhtml Or Xmlserializer
I have an input box on a html page. I know I can get just the value, but I want the entire input string, i.e. , but with the value present: Copy
<inputid="myInput"value="my entry that I just typed in"/>
myVar = document.getElementById("myInput").outerHTML;
if(myVar.charAt(myVar.length - 1) !== "/"){
console.log(myVar.slice(0, myVar.length-1) + "/>");
}
<inputid="myInput"value="my entry that I just typed in"/>
Post a Comment for "Html Input - Getting The Value Via Innerhtml Or Xmlserializer"