jQuery .html() doesn't set value of text area
jquery, textarea
Solution
For setting a value to textarea you should use `val()` method instead of `html()`;
$("#article").val("something");
Problem
``` $(document).ready( function () { $('#test').click(function(){ videofix(); }); } function videofix(){ $('#article').text($('#article').val().replace(/\[video\](http:\/\/(www\.)?youtube\.com\/watch\?v=([a-zA-Z0-9]+))\[\/video]/g,'[video=youtube;$3]$1[/video]')); } </script> <textarea id="article" name="article"></textarea><br> <input type="button" id="test" value="test"> ``` Basically my problem is, the videofix function when called, while working it does not replace the text of the textarea. I've actually copied my code out of this to jsfiddle and tried it there and it worked. So I'm not sure what the hell is going on.