0

I have this:

php

<div id="moneda">
<?php echo $settings['currency_sign'];
?>
</div>

(you can edit with Dropdown https://code.google.com/p/jquery-in-place-editor/) js

$("#moneda").change(function(){
alert($(this).val());
});

alert($(this).val()); (Get text in the dropdown NOT WORKING)

thanks

actual alert from get in js

  • 1
    the change event is fired by an input control like `input`/`select`/`textarea` not by a div – Arun P Johny Apr 08 '14 at 00:09
  • you can have a look at mutation events/observers to solve this – Arun P Johny Apr 08 '14 at 00:10
  • Plus, if you are using a dropdown list you might want to take a look here: http://stackoverflow.com/questions/1643227/get-selected-text-from-drop-down-list-select-box-using-jquery – prichrd Apr 08 '14 at 00:10
  • To use `val()` function, you need to have a `input`, `select` or `textarea` HTML tag. Same thing applies for the `change` event. I think you should replace your `div` for a `select` tag and make sure your content has `` tags. – alexbchr Apr 08 '14 at 00:10

0 Answers0