getelementsbyclassname

Select ALL getElementsByClassName on a page without specifying [0] etc

旧城冷巷雨未停 提交于 2020-01-06 15:18:12
问题 I am trying to create a function as part of a WordPress site, to show/hide page elements with a certain class. E.g. any page elements (rows, containers, text-blocks etc.) that use the class 'show-hide', should be hidden/shown with the click of a button. I have got it working, but I'm sure there must be a better method to achieve a similar result. I'd like to be able to select ALL the show-hide classes on the page without specifying a number ( [1], [2], [3], [3], [6]... ) for each time it's

getElementsByClassName returns [] instead of asynchronous appended node

老子叫甜甜 提交于 2020-01-06 12:42:32
问题 (I ask my question again after the first one was terribly formulated) I face the following problem: <div class="testA" id="test1"></div> The above written element is predefined. I now load a xml tree via XMLHttpRequest & Co. delivering the following response: <response> <div class="colorSelector" id="0-0"> <div class="gbSelector" id="1-0"> <table style="none" id="2-0"></table> </div> </div> </response> I now append the first div using request.responseXML.getElementsByTagName("response")[0]

Bootstrap Carousel Overflow:Hidden Breaks Dropup Button

回眸只為那壹抹淺笑 提交于 2020-01-05 05:56:09
问题 With Twitter Bootstrap, the . carousel-inner style is preset as: .carousel-inner { position: relative; width: 100%; overflow: hidden; } such that overflow: hidden; causes a dropup button to be cut-off on the right-side: http://imageshack.us/photo/my-images/197/dropup.png/ <div class="btn-group dropup"> <button class="btn">Cart</button> <button class="btn dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="#">Baker's Dozen (13)

JS: Making certain elements hidden via getElementsByClassName

寵の児 提交于 2020-01-03 17:16:27
问题 I'm trying to set up a script that sets invisible everything with a certain class name. This is an example of what I'm trying to call: <script type="text/javascript"> function hideItems(){ document.getElementsByClassName('class1').style.visibility = "hidden"; } </script> The class names are on the dimensions of a table, similar to this example: <table onclick="hideItems()" width="200" border="1"> <tr> <td class="class1">1</td> <td class="class2">2</td> <td class="class3">3</td> <td class=

Clicking a button in Internet Explorer using VBA (getElementsByClassName)

别说谁变了你拦得住时间么 提交于 2020-01-03 04:34:30
问题 I'm trying to click a button within an Internet Explorer window using VBA and HTML. The button has no "id" so I have to locate it by "classname." The button's HTML code is as follows: <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only`" VBA Code: Private Sub CommandButton21_Click() Const cURL = "xxxxxx.com" Const cUsername = "xxxxxx" Const cPassword = "xxxxxx" Dim IE As InternetExplorer Dim doc As HTMLDocument Dim LoginForm As HTMLFormElement Dim

Get Element By Classname Script Not Working

若如初见. 提交于 2020-01-02 07:32:30
问题 I know, it's not supported by IE, but I found a cool script online that someone was generous enough to provide for free, but I can't figure out why it's not working. I've been staring at this for hours, please point me in the right direction! My code: <script language="javascript" type="text/javascript" src="getbyclass.js"></script> <script type="text/javascript" language="javascript"> function editToggle(toggle){ if (toggle == "off"){ getElementsByClassName("editp").style.display ="none";

Modify prototypes of every possible DOM element

北慕城南 提交于 2019-12-29 01:43:22
问题 Updated title to better reflect what I'm trying to do. In short, there are different constructors for different dom elements, and they don't seem to all share a common prototype. I'm looking for a way to add a function property to every DOM element by modifying these prototypes, but I'm not sure how to find them. For example, I could do something like this: function enhanceDom (tagNames, methods) { var i=-1, tagName; while (tagName=tagNames[++i]) { var tag=document.createElement(tagName); if

getElementsBy() extract text

非 Y 不嫁゛ 提交于 2019-12-25 01:30:03
问题 I'm really new to VBA and I've been trying to get the value below the Column "Impuesto". I'm getting error 438. I still don't quite understand how to refer to a certain part of the web page. Sub extract() Dim myIE As Object Dim myIEDoc As Object Dim element As IHTMLElement Set myIE = CreateObject("InternetExplorer.Application") myIE.Visible = False myIE.navigate "https://zonasegura1.bn.com.pe/TipoCambio/" While myIE.Busy DoEvents Wend Set myIEDoc = myIE.document Range("B1") = myIEDoc

How to correctly toggle classes using document.getElementsByClassName and Element.classList

被刻印的时光 ゝ 提交于 2019-12-24 23:06:12
问题 I have a page where I want to be able to toggle classes on particular elements on or off. In an attempt to do this I have written a function: function toggleClass(obj) { alert(obj.className); Array.from(document.getElementsByClassName(obj.className)).forEach(function(element) { element.classList.toggle(obj.className); }); } which is called by items in a table e.g <td style=""><span class="determiner" onclick="toggleClass(this)">Determiner</span></td> . This works fine when I first click the

getElementsByClassName returns [] instead of asynchronous appended node

﹥>﹥吖頭↗ 提交于 2019-12-18 04:23:38
问题 (I ask my question again after the first one was terribly formulated) I face the following problem: <div class="testA" id="test1"></div> The above written element is predefined. I now load a xml tree via XMLHttpRequest & Co. delivering the following response: <response> <div class="colorSelector" id="0-0"> <div class="gbSelector" id="1-0"> <table style="none" id="2-0"></table> </div> </div> </response> I now append the first div using request.responseXML.getElementsByTagName("response")[0]