Difference between revisions of "Ns tagelement"
Jump to navigation
Jump to search
(imported from WiKit id 682) |
|||
Line 17: | Line 17: | ||
'''EXAMPLES''' | '''EXAMPLES''' | ||
− | + | <pre> | |
− | + | % set tag {<img height=150 border="0" class="c1 c2" src='me.jpg'>} | |
+ | <img height=150 border="0" class="c1 c2" src='me.jpg'> | ||
− | + | % ns_tagelement $tag id | |
− | + | % ns_tagelement $tag border | |
− | + | 150 | |
− | + | % ns_tagelement $tag class | |
− | + | c1 c2 | |
− | + | % ns_tagelement $tag src | |
− | + | 'me.jpg' | |
+ | </pre> | ||
'''NOTES''' | '''NOTES''' |
Revision as of 04:11, 17 February 2006
Man page: http://aolserver.com/docs/tcl/ns_tagelement.html
NAME
- ns_tagelement - Find the value of an attribute in an HTML element.
SYNOPSIS
- ns_tagelement tag attribute
DESCRIPTION
- This command takes a string containing an HTML element, tag, and searches it for the specified attribute. If the attribute is found, its value is returned. If the attribute is not found, an empty string is returned. If the attribute's value is surrounded by double quotes, they will be removed.
EXAMPLES
% set tag {<img height=150 border="0" class="c1 c2" src='me.jpg'>} <img height=150 border="0" class="c1 c2" src='me.jpg'> % ns_tagelement $tag id % ns_tagelement $tag border 150 % ns_tagelement $tag class c1 c2 % ns_tagelement $tag src 'me.jpg'
NOTES
- Is not removing single quotes surrounding the value a bug?
SEE ALSO