Questions tagged [tagname]
71 questions
158
votes
4 answers
Difference between .tagName and .nodeName
What is the difference between $('this')[0].nodeName and $('this')[0].tagName?

Kdniazi
- 1,581
- 2
- 9
- 3
31
votes
2 answers
jQuery find input type (but also for select)
I need to find the input type for radio buttons, text, and selects. Its easy to find the input type of anything with since $(this).attr("type") would return x
My issue is that I need to support

jaredrada
- 1,130
- 3
- 12
- 25
21
votes
7 answers
jQuery/javascript replace tag type
Is there an easy way to loop through all td tags and change them to th? (etc).
My current approach would be to wrap them with the th and then remove the td, but then I lose other properties etc.

Matrym
- 16,643
- 33
- 95
- 140
19
votes
2 answers
Getting a list of XML tags in file, using xml.etree.ElementTree
As mentioned, I need to get the list of XML tags in file, using library xml.etree.ElementTree.
I am aware that there are properties and methods like ETVar.child, ETVar.getroot(), ETVar.tag, ETVar.attrib.
But to be able to use them and get at least…

FanaticD
- 1,416
- 4
- 20
- 36
19
votes
1 answer
Why does the .tagName DOM property return an uppercase value?
For example, if we have
FooBar
If we do document.getElementByTagName("title").TagName, then we will have TITLE (uppercase). While the html standards recommends writing…

Tamer Shlash
- 9,314
- 5
- 44
- 82
11
votes
2 answers
git: Is there something like per-branch tags?
I have some history rewriting to do for which I'd like to keep my original tree intact for now. The rewritten tree should however copy the tags previously used as well. Is there any less manual option than e.g. prepending tag names with the branch…

Tobias Kienzler
- 25,759
- 22
- 127
- 221
9
votes
4 answers
When and how can I locate an element by tag name using Selenium WebDriver? Please explain with an example
I have used most of the element locators while testing with Selenium, but very low frequently used the 'TagName' locator. Please give an example.

Santosh
- 101
- 1
- 1
- 3
8
votes
1 answer
lxml tag name with a ":"
I am trying to create an xml tree from a JSON object using lxml.etree. Some of the tagnames contin a colon in them something like :-
'settings:current' I tried using
'{settings}current' as the tag name but I get this :-
ns0:current…

Adnan
- 584
- 1
- 15
- 27
8
votes
3 answers
Why does tagName method in JavaScript return HTML tags in capital letters?
Why does tagName method in JavaScript return HTML tags in capital letters?
HTML tags should be written in small letters.

PawelChyla
- 93
- 3
8
votes
5 answers
find whether an element exists by a particular tag name in XML
I have an XML file where some sub tags (child node elements) are optional.
e.g.
But when I read the XML…

Dolphin
- 375
- 2
- 8
- 16
6
votes
1 answer
correct use of tag prefix and tag name?
It looks like both TagPrefix and TagName are both required. I'm wondering what the correct usage of each element would be? The code I've got below doesn't look right, as I repeat the name of the control twice...
<%@ Register…

Kye
- 5,919
- 10
- 49
- 84
5
votes
2 answers
Problems to get element.tagName. Parsing an XML with Python and xml.dom.minidom
I'm parsing an XML with Python (xml.dom.minidom) and I cant get the tagName of a node.
The interpreter is returning:
AttributeError: Text instance has no attribute 'tagName'
when I try to extract (for example) the string 'format' from the…

Manu
- 53
- 1
- 8
5
votes
2 answers
A JS exception caused by 'form' element
Today I ran into this problem and it annoys me a lot...
I'm maintaining a JS project and there's a line:
node.tagName
where node.nodeType is 1.
Obviously the code wants to get the tag name of this element and it seems to work fine for 99.99%…

ChandlerQ
- 1,428
- 2
- 21
- 29
4
votes
1 answer
How do I parse XML with german umlauts in ! names?
I try to parse XML in java by
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new ByteArrayInputStream(msg.getBytes("UTF-8")));
Everything seems to be ok,…

Frank-Thomas Ernst
- 121
- 1
- 4
4
votes
2 answers
Get element tag name and length with Jquery each
I'm trying to get info about all element tags and there frequency in the page, this is how I find the tag, very simple:
$('body *').each(function(){
var string = this.tagName;
But the length doesnt catch up:
var count = $(this).length;
It gives…

Youss
- 4,196
- 12
- 55
- 109