selectors

How select button in JQuery

<?php foreach ($list as $item): ?> <tr> <td> <div id="<?php echo $item['id']; ?>"> <input type="text" name="name" id="name"/> <button type="submit" id="ajax_submit" value="<?php echo $item['id']; ?>">run</button> </div> </td> </tr> <?php endforeach; ?> In this php-code I generate html table. When user click ...

jQuery Selector help

Hi, I have this table: ... <tr> <td>222</td> </tr> <tr> <td>333 222</td> </tr> ... And I have this code for selector: $("#TableName tr td:contains('222')"); Problem: I need to select the cell that the html is '222' only. I try use $("#TableName td tr[html=222]") but don't work. ...

Jquery get all ... inside this or $(this)

how can i get for example all links inside a all ready selected jquery element (this) $("#container li").each(function(){ $("this a").each(function(){ // links inside this li element }); }); This does not work is there a other way? ...

Selector based on text between tags, in Jquery

I need to retrieve data from the DOM, but the containers have no a specific class or id, and sometimes they are not all available. So I could find this: <h2>name</h2> <p>john</p> <h2>address</h2> <p>street 1</p> <h3>email</h3> <p>[email protected]</p> or this: <h2>name</h2> <p>john</p> <h3>email</h3> <p>[email protected]</p> As you can s...

how do i select all a tags with href="#xyz"

hi guys, using pure javascript can i select all a tags with href="#xyz". And also i would like to trigger some event while clicking on that element too... how can i do that? PS: pure javascript means without using jquery or other frameworks ...

how to select elements with specific id without using javascript frameworks?

hi guys, I am trying to find the list of elements that matches the specified id format. like I want to select all the tags with classname "required" or select all the tags with id like myObj[any char] eg. myObj1, myObj2, myObj3, myObja etc ...

Objective-C: Passing a selector to an object

Hey, I'm implementing a button class in cocos2d, and I want to be able to pass the selector when the button is created. Here is Button.m: #import "CCButton.h" @implementation CCButton +(CCButton*) buttonFromImage:(NSString*)image selectedImage:(NSString*)selectedImage atPosition:(CGPoint)position selector:(SEL)selector_method { ...

get reference to previous span object selector

i have the following html: <span class="addEventHidden"><img src="/Content/Images/add.gif"></span> <br> <div class="event">My Event</div> <div class="event">My Event 2</div> <div class="event">My Event 3</div> <div class="event">My Event 4</div> i then have the following event handler when i click on any "event" div: $('.eve...

How do I select everything before Picture_1.png with JS?

I am trying to figure out how to select with JS everything before Picture_1.png in this url: "http://s3.amazonaws.com/hq-photo/development/system/photos/215/cropped_thumb/Picture_1.png" so that the end result is this : "http://s3.amazonaws.com/hq-photo/development/system/photos/215/cropped_thumb" ...

How to pass method arguments to a selector

If I have a method like this: - (void) foo { } Then I can access it through a selector like this: @selector(foo) But what if I have a method like this: - (void) bar:(NSString *)str arg2:(NSString *)str2 { } Then how do I access it through a selector? ...

How should this code be changed to work correctly?

I downloaded some code from http://github.com/matej/MBProgressHUD to show a progress meter when doing something. This is the code that makes the progress meter pop up. [HUD showWhileExecuting:@selector(myTask) onTarget:self withObject:nil animated:YES]; This will show a progress meter while the method myTask is running. The strange ...

Use jQuery to apply styling to all instances of clicked element

What I'm aiming for is for jQuery to look at the element I've just clicked on (for example a p or an li tag), then apply a styling to all instances of that element (so all p tags on the page). This is my code so far, but it only applies the styling to the single element that has been clicked on. $("article *", document.body).click(func...

Calling jQuery function from different elements

I'm pretty new to the jQuery world, so I'm hoping for some help. I am creating a page that has a div that has a number of checkboxes inside of it. Each of these checkboxes are contained in their own divs as well. <div> <div> <input type='checkbox' name='cb1' /> <div id="info1"> Hide </div> ...

How to call a selector in a different class

How would this code be different if the method was in a different class? [saveButton addTarget:self action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside]; ...

Select div with class "n" after another div with another class with Jquery

I have this jquery code to add the onclick event to minimize and maximize images collapsing and expanding the div with class mainBody. It was working before I added the div with class divSectionInfo which is now meant to expand when you click on the icon16 image and collapse divSectionInfo when close image is clicked. I am having probl...

What's the support for .className.andClassName in the current browsers?

Confusing title? Sure! In CSS, you can specify: .button.blue { ... } Which will target elements that have both class names. Does anyone know what the browser support is? ...

help in jquery selector

I am using a jquery selector $('input,select,textarea').not('table input').attr('disabled',true); here I am disabling all input, select, and textarea control. but I dont need to disable any control that is in a table. I have done it using .not('table input') but I also need to mention select along with input control in a table. I hav...

JQuery - One handler for multiple elements using variables

I have two variables defined like this: var $a = $('#a'), $b = $('#b'); How can I rewrite the following line using $a and $b? $('#a, #b').click(function(e){...}); ...

iPhone - cancelPerformSelectorWithTarget not working

If I do this in a subclass of UIView: [self performSelector:@selector(doSomething) withObject:nil afterDelay:5]; Then cancel it like this (I've tried both versions): [[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget:self]; //[[NSRunLoop mainRunLoop] cancelPerformSelectorsWithTarget:self]; The "doSomething" method still...

How to get elements with an ID containing certain text? (Prototype)

I have a set of 3 radio buttons, with these element IDs: id='details_first' id='details_second' id='details_third' How do I get all the elements whose id starts with 'details_' ? EDIT What I'm actually trying to do is this: Each radio button has an associated div that I want to display when the radio button is clicked. At one time o...