Using jQuery selectors to select elements, you have a jQuery object, and you must use the method val()to get / set the value of the input elements.
Also note that the selector is :textdeprecated, and it would be better to trim the text to remove whitespace. You can use the utility function $.trim.
function checking() {
var textBox = $.trim( $('input[type=text]').val() )
if (textBox == "") {
$("#error").show('slow');
}
}
value, jQuery DOM. [index] get.
var textBox = $('input[type=text]')[0].value;
, .
function checking() {
var empty = 0;
$('input[type=text]').each(function(){
if (this.value == "") {
empty++;
$("#error").show('slow');
}
})
alert(empty + ' empty input(s)')
}