单引号与javascript双引号

时间:2017-01-11 09:40:19

标签: javascript

我在javascript中遇到一个问题,我需要像这样的代码

<input type="text" class="form-control" id="from_date"  name="from_date" data-inputmask="'alias': 'dd/mm/yyyy'" data-mask>

我的javascript中的代码是

strinner="<legend>Attachment "+numrows+" </legend><div class='row'> <div class='col-md-4'><div class='form-group'><input type='text' id='attachment_caption"+numrows+"' name='attachment_caption"+numrows+"' placeholder='Attachment caption'  class='form-control'/></div> </div><div class='col-md-3'><div class='form-group'><input type='file' id='document"+numrows+"' name='document"+numrows+"' onclick='disableurl("+numrows+")' /></div></div><div class='col-md-1'><label for=''></label><br>&nbsp;&nbsp;<img src='https://cdn2.iconfinder.com/data/icons/basic-4/512/close-128.png' title='Click to remove File'  id='clear_multiple"+numrows+"' height='18px'  style='cursor:pointer' onclick='remove("+numrows+")'/></div><div class='col-md-4'><div class='form-group'><input type='text'  id='url"+numrows+"' name='url"+numrows+"' placeholder='Attachment URL' onkeyup='disablefile("+numrows+")'   class='form-control'/></div></div></div><div class='row'><div class='col-md-4'><div class='form-group'><label>From Date:</label><div class='input-group'><div class='input-group-addon'><i class='fa fa-calendar'></i></div>**<input type='text' class='form-control' id='from_date1'  name='from_date1'  data-inputmask='alias:dd/mm/yyyy' data-mask>**</div></div></div></div>";

问题出现在strinner的id为from_date的字段中。我需要

 data-inputmask="'alias': 'dd/mm/yyyy'"

请帮帮我

1 个答案:

答案 0 :(得分:1)

使用escape notaion \"退出 http://spsite/_layouts/download.aspx?SourceUrl=http://spsite/Documents/sample.docx

"