Re: OT: [kind of SOLVED] need javascript/DOM help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Sat, Jun 21, 2008 at 1:10 AM, Mike Wright <mike.wright@xxxxxxxxxxxxxx> wrote:
Mike Wright wrote:
Bassel Safadi wrote:

On Sat, Jun 21, 2008 at 12:09 AM, Mike Wright wrote:

Are there any _javascript_/DOM gurus out there who can tell me why the html page below does not behave as expected?

Below is the html being tested.

=====================

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html
 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>_javascript_ DOM Experiments</title></head>
<body>
<p   id='m'></p>
<a   id='a'></a>
<script type='text/_javascript_'><!--//
var d = document;
var m = d.getElementById('m');
var a = d.getElementById('a');

var a = d.getElementById('a').getAttribute('id');
gives me the 'id'.  From there I can create the 'id' of the desired tag, which solves my immediate problem.

I'm still curious as to why the <a> behaves differently???

I don't know for sure why it behaves like wise but you can find here:
http://www.w3schools.com/HTMLDOM/dom_obj_anchor.asp
a list of properties you can call by using:

var a = d.getElementById('a').Property;
or:
var a = d.getElementById('a').getAttribute('Property');

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux