I am creating an input field dynamically. I want to test to see if the user pressed the "Enter Key" to start processing. I seem to need 3 wrappers single quote ', double quote " and one more. Below are two attempts I have made to get around the limitation of only two delimiters. Neither works.
How can I write the code below so it is properly delimited?
example 1
example 2
How can I write the code below so it is properly delimited?
example 1
Code:
td.innerHTML = '<INPUT'+
' type="text"'+
' name="SEARCH"'+
' id="SEARCH"'+
' onKeyPress="if ( isEnter( event )) { onClick="psRequestData(this)" };"'+
' />';
Code:
var cInsert = 'onClick="psRequestData(this);"';
td.innerHTML = '<INPUT'+
' type="text"'+
' name="SEARCH"'+
' id="SEARCH"'+
' onKeyPress="if ( isEnter( event )) {'+cInsert+'};"'+
' />';
Comment