Jump to content

Using w3.css Modal with an image


Ron Brinkman

Recommended Posts

I have successfully used a Font Awesome icon that, when the icon is clicked, invokes a Modal like so:

<span style="font-size: 15px; color: Teal;"> <i onclick="document.getElementById('S9id01').style.display='block'" class="fa fa-info-circle"></i></span>

I am trying to invoke a Modal by clicking on a .jpg image rather than a Font Awesome icon like so:

<span> <i onclick="document.getElementById('S9id01').style.display='block'" <img src="VoteFraudPenaltySm.jpg">></i></span>

This yields a ">" being show on the web page, with no image.  I've tried numerous variations with no success.  There's obviously some fundamental concept I'm not understanding to get the syntax right.

Best Regards,

Ron Brinkman

Link to comment
Share on other sites

The syntax is wrong. You forgot the put a closing ">" on the <i> element and instead added two of them on the <img> element:

<span> <i onclick="document.getElementById('S9id01').style.display='block'" <img src="VoteFraudPenaltySm.jpg">></i></span>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...