Here’s a very simple question… can I add/chain the JS method .split() to jQuery’s .val() method? For example…
var myNewArray = $("#myString").val().split(",");
I seem to get $("#myString").val().split is not a function in Firebug? I thought I could chain my JS and jQuery methods, perhaps I was wrong?
Thanks
Why don’t you have a look at the documentation? It says:
So you can use
.split()in 30% (to be more precise: 33.33…%) of the cases. It depends on which element you are using.val()on.So the answer to your question is: It depends.