0

I would like to know how to move an element, specifically a select dropdown box, from one place to another on a webpage. Unfortunately the element code is only located in the DOM.

enter image description here

This select dropdown box is located at the bottom of the page at http://thehungrygeek.com/2015/11/17/australia-dairy-company/

The code, only located in the DOM, is as follows:

<select style="width:200px" name="lc_currency1" id="lc_currency1" onchange="localCurrencyChange('SGD',lcValues1,1)">...</select>

The select dropdown box is supposed to be moved here:

enter image description here

The relevant code at the area is as follows:

<form name="lc_change1" id="lc_change1" action="http://thehungrygeek.com/2015/11/17/australia-dairy-company/" method="post"> 
Show currencies in
<noscript>[Please enable JavaScript to change the currency used on this page]</noscript> 
<br>
<small>Powered by LocalCurrency. Rates from <a href="http://finance.yahoo.com" title="Visit Yahoo! Finance" target="_blank">Yahoo! Finance</a></small>
</form>

Not too certain the best way to go about this but I suspect some form of jQuery. Thanks for any help!

EDIT: So I have tried the following jQuery code to do it but it does not work:

<script type="text/javascript">
jQuery('[id^=lc_currency]').insertAfter('[id^=lc_change]');
</script>

Any coding suggestions?

David Z
  • 93
  • 1
  • 3
  • 19
  • 1
    Here is a quick post that may help http://stackoverflow.com/questions/1363650/javascript-moving-element-in-the-dom?rq=1. – jsh Jan 02 '16 at 09:11
  • Oh come on, this question is not a duplicate, it is a specific question asking for a specific solution. @jsh, thanks for reference I'll have a look – David Z Jan 02 '16 at 09:17

0 Answers0