0

I currently have a table like the following:

<table>
<tbody>
<tr>
<td>List 1</td>
<td>List 2</td>
<td>List 3</td>
<td>....</td>
</tr>
<tr>
<td>This section would be the dropdown that will contain pdf files</td>
<td>......</td>
<td>.....</td>
<td>.....</td></tr>
</tbody>
</table>

I am wondering if it is possible to create a dropdown menu that will display list of pdf files and once you click on them, opens up on a different window.

If possible, can anyone direct me to the right direction?

Thanks

Roberto Flores
  • 775
  • 2
  • 12
  • 46
  • 1
    It's definitely possible. So you can create a dropdown using the [``, or any other kind of element, using [`document.createElement`](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement). Then, as you can see in the tutorials there, you can append those elements to the DOM and you're good to go. – Mike Cluck Apr 20 '16 at 22:09
  • 1
    I hope this helps: http://stackoverflow.com/questions/17001961/javascript-add-select-programmatically – JGV Apr 20 '16 at 22:12
  • [this could help](https://jsfiddle.net/TechNinja/hf7p699h/2/). you could user jQuery or other library like bootstrap to cut your code down. – 4UmNinja Apr 21 '16 at 00:13

1 Answers1

1

Just make a div container under it as so, then just add a div under it with an absolute value so it looks like this.

<style>
    #container div{
        display: block;
    }

    #dropdown {
        display: none;
    }
</style>
<div id='container'>
<div id='dropdown'>Line1<br>Line2<br>Line3</div>

DrBrad
  • 305
  • 2
  • 13