javascript - how to click a button using jQuery? -
here dom :
<div class="form-actions"> <button class="btn btn-primary" type="submit">save device</button> </div> i want use jquery select button , click on it? tried using : jquery(".btn btn-primary").click() not working
you trying select element both classes, therefore selector should .btn.btn-primary.
$('.btn.btn-primary').click(); you trying select element class .btn-primary descendant of .btn element.