我如何在多行像jQuery聲明一個變量的字符串變種,聲明與多條線路在JavaScript/jQuery的
原始變量:
var h = '<label>Hello World, Welcome to the hotel</label><input type="button" value="Visit Hotel"><input type="button" value="Exit">';
我要聲明的變量:
var h = '<label>Hello World, Welcome to the hotel</label>
<input type="button" value="Visit Hotel">
<input type="button" value="Exit">';
+1或者如果你想在輸入中輸入一個輸入,像' \ n \ n '; – ncm
@imsiso這看起來像HTML。他爲什麼要追加'\ n'? :) – thefourtheye
+1或者他甚至可以連接像http://jsfiddle.net/pQYjd/ –