I'm using jquery to find the value of an attribute
var dataWidth = jQuery('#myContainer').attr('data-width');
I'm trying to check the dataWidth var is both a numeric value and is less than 320. If it's not then set a default value. Here is what I have at the moment.
if(parseInt(dataWidth) > 320) {
var dataWidth = 320
}
Can anybody let me know what i'm doing wrong?