views:

645

answers:

2

I have this input in a form:

<input type="text" value="<script src='/js/script.js' type='text/javascript'></script>"  name="embed"/>

The quotations in general have to be double, so I put single-quotes within the value property.

However, when I do that, the result is:

<script src=’/js/script.js’ type=’text/javascript’></script>

Notice that these are apostrophes, not single quotes! Big difference when it comes to HTML.

I'm using Django, and have already tried using a couple template tags, but it hasn't helped.

I also tried &#39, but it isn't converted when it's included within the property value, so that doesn't help either.

This seems like one of those HTML 101 things, but it's really very annoying. Any ideas about how I could fix this?

A: 

What text editor are you using?

nezroy
+3  A: 

Try:

<input type="text" value="&lt;script src=&quot;/js/script.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;" name="embed"/>
Ates Goral