jquery maskedinput. How to check availability of the mask -


can me checking availability of mask. use one:

if ($.isfunction($("#id").mask)){     var val = $("#id").mask(); } else {     var val = document.getelementbyid(id).value; } 

but condition true. don't matter written with:

$(document).ready(function(){   $("#id").mask("8 (999) 999-9999"); } 

or not.

if you're trying verify if .mask() function available, should try checking $.fn.mask.

if you're trying verify whether element has mask, test if $("#element").data("rawmaskfn") defined.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -