# Passing string in function.. error HELP

**URL:** <https://forum.kirupa.com/t/passing-string-in-function-error-help/208596>\
**Category:** Uncategorized\
**Created:** [November 30, 2006, 9:31am UTC](https://forum.kirupa.com/t/passing-string-in-function-error-help/208596 "2006-11-30T09:31:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trestian](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@trestian](https://forum.kirupa.com/u/trestian)\
**Post date:** [November 30, 2006, 9:31am UTC](https://forum.kirupa.com/t/passing-string-in-function-error-help/208596/1 "2006-11-30T09:31:28Z")

</div>

Good Day!

can any body help me or explain me why java script function will not accept single quote?

here is the example

function(test)  
{  
alert(test);  
}

HTML Code

\<form\>  
\<input type=“button” onclick=“myfunction(‘Good Morning!’);” \>  
\</form\>  
------------ this code is OK but  
if the onclick value will have a single quote onclick="myfunction(‘Good Morning Jhon’s!’)

it will error: missing ) argument list.

this any way to fix this… is java script has a covert function like to convert single quotes?

Please help me im stuck, any explination on this
