1
I’m trying to pass a figure through a input type hidden
HTML generated in PHP for Javascript, but this variable in Javascript is undefined. What can be?
PHP
<form name='form5' method='post'>
<input type='hidden' name='id-playlist' value='$consulta[id_playlist]'>
<input type='image' id='carregar-playlist' src='images/play-circle-24.png' alt='Botao'>
</form>
Javascript
$(document).ready(function(){
$(document).on('click', '#carregar-playlist', function () {
id_playlist=$("#id-playlist").val();
alert(id_playlist);
});
On the fly! Thanks!
– Ricardo