1

Edit: this solves my problem https://stackoverflow.com/a/12128784/1162817

I'm using html inside this Bootstrap popover, but i got stuck. I can't use quotes or single quotes inside onclick because it closes wrong things. How can i bypass it?

<a href="#" data-toggle="popover" data-placement="bottom" data-html="true" data-content="
    <div class='div-social-icons'>
        <ul>
        <div onclick='location.href="link.html"' class='social-icons icon-facebook'></div>
        <li class='social-icons icon-youtube'></li>
        <li class='social-icons icon-vimeo'></li>
        <li class='social-icons icon-instagram'></li>
        </ul>
    </div>
    <div id='div-form'>
        <form action='mail.php' method='post'>
        <input type='email' name='email' placeholder='email'>
        <textarea style='font-size: 12px;padding: 10px;width: 100%;' rows='4' cols='66' name='msg' placeholder='mensagem'></textarea><br>
        <input type='reset' value='reset'>
        <input type='submit' name='Submit' value='send'>
        </form>
    </div>
    </div>">
Contact</a>
Community
  • 1
  • 1
Artur Haddad
  • 1,429
  • 2
  • 16
  • 33

1 Answers1

0

This may not work in every situation, but in this case, you can remove the double-quotes around link.html and it will work (Note: quotes are not required in HTML5; see this question for more information).

<a href="#" data-toggle="popover" data-placement="bottom" data-html="true" data-content="
<div class='div-social-icons'>
    <ul>
    <div onclick='location.href=link.html' class='social-icons icon-facebook'></div>
    <li class='social-icons icon-youtube'></li>
    <li class='social-icons icon-vimeo'></li>
    <li class='social-icons icon-instagram'></li>
    </ul>
</div>
<div id='div-form'>
    <form action='mail.php' method='post'>
    <input type='email' name='email' placeholder='email'>
    <textarea style='font-size: 12px;padding: 10px;width: 100%;' rows='4' cols='66' name='msg' placeholder='mensagem'></textarea><br>
    <input type='reset' value='reset'>
    <input type='submit' name='Submit' value='send'>
    </form>
</div>
</div>">

Contact

Community
  • 1
  • 1
Trevor
  • 13,085
  • 13
  • 76
  • 99
  • if you changed onclick to `onclick=relocated()` where relocate = `function() { location.href = "link.html"; }`, perhaps? – Trevor Apr 14 '14 at 16:26