if (inp.val().length > 0) {
// do something
}
if you want anything more complicated, consider regex or use the validation plugin which takes care of this for you
More Related Contents:
- How can I use JQuery to post JSON data?
- Is it possible to use jQuery .on and hover?
- How to send a PUT/DELETE request in jQuery?
- Send JSON data via POST (ajax) and receive json response from Controller (MVC)
- How can I post an array of string to ASP.NET MVC Controller without a form?
- How to enable or disable an anchor using jQuery?
- jQuery Date Picker – disable past dates
- How to trigger click event on href element
- jQuery OR Selector?
- Using jQuery to build table rows from AJAX response(json)
- How can I set the value of a DropDownList using jQuery?
- Detecting no results on jQuery UI autocomplete
- jqGrid resolve the grid pager ID dynamically?
- jQuery load external site page
- jquery input select all on focus
- Set width of a “Position: fixed” div relative to parent div
- What is “traditional style of param serialization’ in JQuery
- jQuery Validate plugin – password check – minimum requirements – Regex
- Mobile site – force landscape only / no auto-rotate
- jQuery delay not working
- Trigger change event using jquery
- jQuery multiselect drop down menu
- How does GitHub change the URL without reloading a page?
- success callback after knockout.js finishes rendering all the elements
- Ajax – How refresh after submit
- select2 and jquery validation not working properly
- How can I create a “Please Wait, Loading…” animation using jQuery?
- jQuery modal dialog and jqGrid
- Why is Everyone Choosing JSON Over XML for jQuery? [closed]
- jQuery: append() object, remove() it with delay()