I know the selector used for the name, $('input[name=xyz]') but what if I have an ex condition.
$('input[name=xyz]')
if (input.is("[name=listItem,GrdFromDateTime,GrdToDateTime,GrdRemarks]"))
how can i achieve this
Thanks in Advance :)
Store the names in the array and check if the current attribute is namein the array.
name
var names = ["listItem", "GrdFromDateTime", "GrdToDateTime", "GrdRemarks"]; if(names.indexOf(input.attr('name')) !== -1) {
try it
var validValues = "listItem,GrdFromDateTime,GrdToDateTime,GrdRemarks"; if ( validValues.split(",").indexOf( input.attr("name") !== -1 )
I thought you need to check if the entire complete string matches
$("input").is("[name=listItem], [name="GrdFromDateTime"]...)
Source: https://habr.com/ru/post/1621411/More articles:Установка Drupal: установите xdebug.max_nesting_level = 256 в вашей конфигурации PHP - phphow to check true or false = extended area? - javascriptHow to add space between elements when printing them in Smalltalk OrderedCollection? - smalltalkPHP - отображение $statement внутри массива - stringgetting product id in laravel - phpНе удалось получить значения из Cassandra с помощью DataStax С# Driver - c#Phantomjs Mechanization Configuration - perlHow to insert an image in phpmailer - I can not do this, why? - phpHow to get API ID from AWS API Gateway - aws-api-gatewayhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1621416/configure-systemjs-to-load-my-angular-2-component&usg=ALkJrhg4J5h_26i_7QAt7E6a66QD5lnIdQAll Articles