Is there any difference between
var mysel = document.getElementById("mySelect"));
mysel.val("1")
and
var myobj = $("#mySelect");
mysel.val("1")
In my case, I am going to change the default select option. But I can't make it work with getElementById
. By rewritting it with $("#mySelect")
, it works.
So I am confused about the difference between them?
Thanks!