selector

CSS Selector: Select TR where TD contains special value

五迷三道 提交于 2019-12-08 14:07:00
问题 I have a Table like this: <table> <tr> <td> row4545 </td> </tr> <tr> <td> row22 </td> </tr> <tr> <td> row6767 </td> </tr> </table> I want to set a background-color on the tr which contains the value row22 in a td. Is it possible to select it somehow with CSS? PS: I use jQuery. 回答1: Try $('tr td').filter(function(){ return $.trim($(this).text()) === "row22"; }).parent().css('background-color', 'blue') Demo: Fiddle 回答2: $('td').filter(function(){ return $.trim($(this).text()) === "row22"; })

What will be the best way to select Drop-down item in dojo based HTML in Java- Web-driver?

拈花ヽ惹草 提交于 2019-12-08 12:01:51
问题 I am working on an Auto-select drop-down which internally seems to be not a `Select control. Currently I am using driver.findelement(By.xpath"<my path>").sendkeys("intended-drop-down-value",Keys.ARROW_DOWN,Keys.RETURN); then click on simple text-box elsewhere in the screen,It works generally. But on some occasions its not completely selecting the intended value in drop-down. Kindly advise a best method to select values in this case? Note: I have very minimal control on the HTML of the

Consumer's selector issue on activeMQ

余生长醉 提交于 2019-12-08 10:17:39
问题 The scenario:I send fifty thousand messages to the queue named JUST.CN. And seting one message propertyString "myfilter='abc'" every 1000 message.Now I create consumer with the same selctor to consume messages.However the comsuming rate is very slow especialy after 30000 messages.I cant change default configuration in activeMQ. The Core Code is below: IDestination destination = SessionUtil.GetDestination(session, "JUST.CN"); IMessageProducer producer = session.CreateProducer(destination);

Using multiple jQuery selectors?

こ雲淡風輕ζ 提交于 2019-12-08 09:12:52
问题 This is my example code: <input type="text" id="input1" /> <input type="text" id="input2" /> <div id="result"></div> And in jQuery I want to listen to both inputs change somehow like this: $('#input1,#input2').change(function(){ var val1 = $('#input1').val(); var val2 = $('#input2').val(); [...some more code...] }); but I just can't get it to work... Any help? Thanks in advance... 回答1: What doesn't work? See http://jsfiddle.net/XYSwz/ Html <input type="text" id="input1" /> <input type="text"

Javascript: How to check if element is visible?

风流意气都作罢 提交于 2019-12-08 07:08:56
问题 i'm using the lightweight zepto.js framework and now I need to test if an element on the page is visible or not … this my case: A button triggers the function show_guides() . function show_guides() { $('#guides').toggle(); if ( $('#guides').is(':visible') ) { // does not work //$.cookie('guides_visible', 'true'); console.log("visible"); } else { console.log("invisible"); //$.cookie('guides_visible', null); } } If the $('#guides') are visible I want to save a cookie and if they are not I want

How to modify the elements in an html string before appending

♀尐吖头ヾ 提交于 2019-12-08 06:28:12
问题 Maybe I oversimplified my question in https://stackoverflow.com/posts/20577488/ I left out an important intermediate step. I wanted to: create a Javascript string x assign x to a jQuery object (right term?) perform jQuery stuff on this object then append it var x = "<p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p><p>Test</p> "; var template = $(x); template.find('p').attr('class','something'); template.appendTo( ".inner" ); 回答1: You need to use filter instead of find . What you are

Set selected using jQuery

徘徊边缘 提交于 2019-12-08 06:22:22
问题 I'm trying to change the selected option within this list.. Its only working for some and not others? selectedVal will either be Kelly Green, Navy etc... var selectedVal = $(this).text(); $("#product-variants-option-0 option[text=" + selectedVal+"]").attr("selected","selected") ; This is the select list: <select class="single-option-selector" id="product-variants-option-0"> <option value="Gunmetal Heather">Gunmetal Heather</option> <option value="Kelly Green">Kelly Green</option> <option

Changing Textcolor and Background of a TextView

荒凉一梦 提交于 2019-12-08 06:07:27
问题 I am totaly new in Android development. I try to change the FontColor and the Background of ListViewItem if it`s selected or pressed. Changing the Background is absolutely no Problem by using following selector: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/background_pressed"></item> <item android:state_focused="true" android:drawable="@drawable/background_pressed"><

Get element property with JQuery selector and Selenium IDE 2.0.0

拈花ヽ惹草 提交于 2019-12-08 04:57:32
问题 I've got a webpage that selects a custom-made Raphael radio button immediately after the page loads. I'm trying to verify that the appropriate id is selected using Selenium IDE 2.0.0 and FireFox 20.0.1. I've tried the following... |getEval | javascript{selenium.browserbot.getUserWindow().jQuery('.response-options.selected').prop('id')} | | ...but I simply get null as a result. As a test, I've tried... |getEval | javascript{selenium.browserbot.getUserWindow().jQuery('#item-responses-A1_1a_No')

Which method should I use (fastest) to select element?

a 夏天 提交于 2019-12-08 04:04:02
问题 Well there are a lot of different methods to select elements between Drivers. I would like to know which one is the fastest and the most suitable for native apps (iOS and Android) . With the Appium Driver class there is : findElementByAccessibilityId(String using) With the Mobile class there is : findElement(org.openqa.selenium.By by) //with ById/Xpath/Name/ClassName... With Android and iOS driver class there are : findElementByAndroidUIAutomator(String using) findElementByIosUIAutomation