Q:

string length jquery

// How to check the length of input field in jquery
$("selector").val().length
// If '0' is returned, it means input field is empty
2
var myString = "string test";
var stringLength = myString.length;

console.log(stringLength); // Will return 11 because myString 
// 							  is 11 characters long...
17
var string = "string"
string.length
0

New to Communities?

Join the community