How to retrieve the text given in any field using javascript in C#?
sumry.innerHTML += "<li>" + f.getAttribute("Text") + "</li>" + "<br/>";
f.style.borderColor = "#FF0000";
f.focus();
How to retrieve the text given in any field using javascript in C#?
sumry.innerHTML += "<li>" + f.getAttribute("Text") + "</li>" + "<br/>";
f.style.borderColor = "#FF0000";
f.focus();
You're probably looking for .nodeValue, possibly .innerHTML, possibly .value for a form field.
.getAttribute() will retrieve an attribute from a tag, such as id or name. It won't get the content of the tag.
Your current code is expecting an element formed like this:
<some_element id='blah' text='hey hey hey' />`
Of course, text is not an attribute, so there's no return value.
<input> and <textarea>, use .value..value as described in this answer. For example: document.getElementById("myTextBox").value.