You have overlapping of '
quote inside the JavaScript. You need to escape the single quote like this:
echo '<input type="submit" value="Click!" style="width:100px;" onclick="$(\'#loading\').show();"/>'
// Notice the backslashes? ^ ^
1
solved Echoing html code in php [closed]