if statement compare number with element
Hi,
I'm trying to get an element from
- <td colspan="4" align="left" id="mkv"></td>
which receives its value via ajax, then comparing it with a number, unfortunately, I kept getting
in firebug?
What am I doing wrong?
Below is my code
- if (parseInt($(#mkv).html()) > 50000)
- {
- $('#coverage').attr('disabled','true');
- $('#coverage option').attr('option',:first);
-
- }//end of if statement
- else
- {
- //adds a loading animation for coverage
- $("#coverage").html("<option>Loading...</option>");
- $('#coverage').attr('disabled','false');
-
- //lists the coverage
- $.ajax
- ({
- type: "POST",
- url: "<?php echo base_url();?>index.php/welcome/coverage",
- data: "modelID=" + $('#model').val() + "&" + "mkv=" + $('#mkv').text(),
- success: function(msg)
- {
- $("#coverage")
- .html(msg);
- }
- }); // end of the ajax
- } //end of else statement
Thanks