i am trying to clear the text when the user onclick on the text input control as shown below but its not happening… below is the code
var generate_message = $("<textarea onclick='if (this.value == 'Enter message here...') this.value = ''' rows='5' cols='45' id='comment'>Enter message here...</textarea>");
You cannot use single quote in html and javascript. It causes confusion in browser renderer
Usually, I separate the use of single quote and double quote. I use double quote for html and single quote for javascript
See example below
See Fiddle example
I just realised that you have $(“…”) so what i suggest you can escape the single quote by putting \
see updated fiddle here