$("#experiences tr")
For the above one,how to judge if it's empty or not?
I thought its boolean value should be false,but seems not.
$("#experiences tr")
For the above one,how to judge if it's empty or not?
I thought its boolean value should be false,but seems not.
use the length property:
$("#experiences tr").length
if it's 0 it's empty
Or, if you just want to affect only the empty elements, use
$('#experiences tr:empty')
or the other way around:
$('#experiences tr:not(:empty)')
var experienceRows = $('#experiences tr'),
len = experienceRows.length;
if ( len ) {
} else {
}