输入值中有多个双引号
问题描述:
I want to ask if it is possible to add multiple double quotes to the input value, like this:
<input value= "<iframe src="http://xxx.xx/embed?t=<?php the_title(); ?>"
width='640' height='360'
allowscriptaccess='always' allowfullscreen='true'
scrolling='no' frameborder='0'></iframe>"
So, the whole <iframe>
element is wrapped within double quotes, just as the value of the src
attribute (the URL), but the URL will not be included in value.
Can this be achieved?
我想询问是否可以在输入值中添加多个双引号,如下所示: p >
&lt; input value =“&lt; iframe src =”http://xxx.xx/embed?t =&lt;?php the_title(); ?&gt;“
width ='640'height ='360'
allowscriptaccess ='always'allowfullscreen ='true'
nscrolling ='no'frameborborder ='0'&gt;&lt; / iframe&gt;”
code > pre>
因此,整个&lt; iframe&gt; code>元素都包含在双引号内,就像 src code>属性的值一样( URL),但URL不会包含在值中。 p>
可以实现吗? p>
div>
答
You can try escaping double quotation with backslash..... For more info visit How to properly escape quotes inside html attributes?
<input value= "<iframe src="http://xxx.xx/embed?t=<?php the_title(); ?>"
width="640" height="360"
allowscriptaccess="always" allowfullscreen="true"
scrolling="no" frameborder="0"></iframe>"