Use val() instead of text()
var hv = $('#h_v').val();
alert(hv);
You had these problems:
- Single quotes was not closed
- You were using
text()for an input field - You were echoing
xrather than variablehv
Use val() instead of text()
var hv = $('#h_v').val();
alert(hv);
You had these problems:
text() for an input fieldx rather than variable hv