I have a textarea with this content
<textarea id="testContent"> <img src="..." alt="value"> My text.... </textarea>
I know I can use javascript to select the alt value of just img tag as shown
<script>
var $textfeldVal = document.getElementById("testContent");
$img = $textfeldVal.getElementsByTagName("img")[0];
alert("ALT VALUE: "+$img.alt);
</script>
Is there a way I can use javascript to select the alt value <img>
along with the text in the textarea?