$(function(){
$(\"input#step2\").trigger(\"click\");
});
Makes sure the document is ready.
Question
I have this Input type submit:
<input type="submit" name="step2" id="step2" class="btn_orange" value="Continue ››">
If I do a console.log of this button .val(), I get it:
console.log($("input#step2").val());
Result: "Continuar ››"
I put the following trigger to click the button:
if($price < 1){
echo "
<script type=\"text/javascript\">
$(\"input#step2\").trigger(\"click\");
</script>"; // TODO
} ?>
And doesnt works. If I write this code in the inspect, it works.
Where is the problem?
Regards
La solution
$(function(){
$(\"input#step2\").trigger(\"click\");
});
Makes sure the document is ready.