jquery - find a pattern anywhere in a string? -


When it comes to selectors and patterns, I still get a bit confused ... Actually, I parents I'm trying to find an input item's div and if a string gets anywhere in its ID, then I want to set it to be displayed to anyone

I did this by doing something like First done:

  if ($ ('div [id * = string]')) {$ (this) attr ('display', 'any'); }  

But, I'm not sure how to do that for a variable?

As far as I have found, and then I get stuck ...

  $ ('input.rclass'). Each (function () {var myDiv = $ (this) .Parent (). Parent (); if ($ (myDiv ...});  

markup looks like this = "Editgci [0] [fua] [value]" class => for

"Option" & gt; input type = "radio" class = "arxas" value = "" name = "edit [0] [fua] [value]" id = "editgci-0-value-string- Idnum "& gt; N / A & lt; / label> & lt; / div & gt;

attr is used for the "text">

setting element, so your line:

  if ($ ('div' Id * = string] ')) {$ (this) .attr (' display ',' none ')}}  

should be:

  If ($ ('div [id * = string]')) {$ (this) .css ('display', 'none')}}  

instead of css Use the method.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -