I'm using a javascript function in my html click and pass three parameters in it
<div class="save_button" onclick="savetext('text','text_2000','Plan to share my experiences this week.')">Submit</div>
This is working fine for the function
function savetext(type,text_id,text_body){
// mycode
}
Note: The 3rd parameter can be any text
When the 3rd parameter came like
<div class="save_button" onclick="savetext('text','text_2001','It's hot today, what I'll do? (better not to go outside!).Let's have an ice cream')">Submit</div>
showing the error in console
Uncaught SyntaxError: missing ) after argument list
I know it due to additional ( , ) and ' coming on the parameter.
But I couldn't able to remove that 3rd parameter because its dynamic
How it can fixed.??
savetextand defining funtionsavecomment'It's hot today, what I'll do? (better not to go outside!).Let's have an ice cream'