Removing HTML tags in an input element.
index.html (Removing HTML in INPUT element).
This is the script
<html>If the code above didn't worked try placing the script after the input element.
<head>
<script>
var el = document.getElementById("in"); // or just another HTML DOM element
var text = el.value.replace(/<[^>]+>/g, "");
document.getElementById("in").value=text;
</script>
</head>
<body>
<input id="in" value="<a>Subin</a>">
</body>
</html>
This is the script
<script>
var el = document.getElementById("in"); // or just another HTML DOM element
var text = el.value.replace(/<[^>]+>/g, "");
document.getElementById("in").value=text;
</script>
No comments:
Post a Comment
Leave the comments