Javascript click event return null from the Invoice Price textbox

Hi,
I am trying to get the Price value in Invoice Create Invoice Form using simple javascript to calculate further but the click event return null value. I have tried almost everything, i think i am missing something, can anyone help ? No clue what else to check…

below are the code snippet:
File location : invoices\views\view.php

Below is the javascript code:

$(‘.btn_add_calc’).click(function (e){
$(‘.item_price’).focus();
alert($(‘.item_price’).val()); //return null
$(‘.item_price’).val(’ ');
console.log(e);
});

Below are the html code for textbox and button :

Thank you

Does this help

1 Like