<html> <head></head> <body> <div>sampe ref <a href="ref1" onclick="PopOverReference(this)">1</a> sampe data</div> <div>sampe ref <a href="ref2" onclick="PopOverReference(this)">2</a> sampe data</div> <div>sampe ref <a href="ref3" onclick="PopOverReference(this)">3</a> sampe data</div> . . . . . <div> <div>reference</div> <div class="Bib" id="ref1"> ref1 need to show in popover when click 1</div> <div class="Bib" id="ref2"> ref2 need to show in popover when click 2</div> <div class="Bib" id="ref3"> ref3 need to show in popover when click 3</div> </body> </html>
function PopOverReference(var refCit) { var attrValue=refCit.getAttribute("href"); var refs=document.body.getElementsByClassName("Bib"); for(var r=0, n = refs.length; r < n; r++) { if(attrValue=r.getAttribute("id")) { var bindToMe = document.createElement('div') bindToMe.innerHTML = r.innerHTML; $('#target').popover({ content: bindToMe, placement: 'bottom', html: true }); } } }
var
function PopOverReference(refCit)
return false
onclick
onclick="PopOverReference(this);return false;"
<a href="#ref1" ...
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)