OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to use triple quotation marks for inline JS in HTML

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Guest
I have a page where I can't use <script></script> and I have to place inline JS within the HTML.

I'm having trouble finding a triple quotation to change the css background-image URL via JS where I'm already using single and double quotation marks e.g.

Code:
<div onmouseover='document.getElementById("anotherDiv").style.backgroundImage = "url("https://www.test.com/image.jpg")";"></div>

where I need a triple quotation mark to wrap:

Code:
url("https://www.test.com/img/20-test-1.jpg")

Any thoughts?
<p>I have a page where I can't use <code><script></script></code> and I have to place inline JS within the HTML.</p>
<p>I'm having trouble finding a triple quotation to change the css <code>background-image</code> URL via JS where I'm already using single and double quotation marks e.g.</p>
<pre class="lang-html prettyprint-override"><code><div onmouseover='document.getElementById("anotherDiv").style.backgroundImage = "url("https://www.test.com/image.jpg")";"></div>
</code></pre>
<p>where I need a triple quotation mark to wrap:</p>
<pre class="lang-js prettyprint-override"><code>url("https://www.test.com/img/20-test-1.jpg")
</code></pre>
<p>Any thoughts?</p>
Continue reading...
 

Latest posts

ن
Replies
0
Views
1
نعمان منذر محمود الجميلي
ن
Top