maures maures - 4 days ago 4x
HTML Question

Open pdf embedded in a div

I have a webpage that show me some pdf uploaded previously, but I want that when I click on their link, open it into a named div.

My code:

<div class='row'>
<div class='col'>
<a href='pdf1.pdf'>pdf1</a>
<a href='pdf2.pdf'>pdf2</a>
<div class='col' id='preview'>OPEN PDF PREVIEW</div>

If I click on "pdf1" or "pdf2" my two files may open into div with id PREVIEW

I've tried with some jquery functions, without luck.


You can do as follow:

<iframe src="" style="width:718px; height:700px;" frameborder="0"></iframe>

you just have to pass your pdf path to url