href

How to read the contents of a href with javascript?

旧巷老猫 提交于 2021-01-24 18:59:26
问题 I have the following html and am stumped as to how to read the contents of the href tag? <p class="xyz-title"> <a href="http://www.youtube.com/embed/xyz"> <span class="field-content">Title here</span> </a> </p> I tried document.getElementByClass('xyz-title')[0].innerHTML but that didn't work obviously. Thanks very much for pointing me in the right direction. 回答1: It is a syntax error. It is supposed to be getElementsByClassName. Use this instead: document.getElementsByClassName('xyz-title')[0

Links of “href=http://localhost/~~~” in HTML code at server cannot be reached from client

落爺英雄遲暮 提交于 2021-01-24 13:40:26
问题 I'm new to HTML world. I created a "example.html" web page at server, which contains following a tag links. ... <nav> <ol> <li><a href="http://localhost/link1.html">link1</a></li> <li><a href="http://localhost/link2.html">link2</a></li> <li><a href="http://localhost/link3.html">link3</a></li> </ol> </nav> ... If I open this "http://localhost/example.html" page on server's web browser and click on links(link1~link3), they work. The problem is that they DO NOT WORK on client's web browser. I

Changing country code subdirectory from URL

懵懂的女人 提交于 2021-01-07 06:59:54
问题 I need to change the country code in the URL when I select the country from the dropdown. Currently I only have 3 countries in the dropdown, but when I switch from SG (testing.com/sg/features) to IE, the resulting URL becomes (testing.com/ie/sg/features). It works fine when I switch from IE(testing.com/ie/features) to SG(testing.com/sg/features) tho. <form name="form1"> <select class="region regionTopBar" onchange="formChanged(this);" name="country" size="1" style="font-family: inherit;

Changing country code subdirectory from URL

不羁的心 提交于 2021-01-07 06:58:32
问题 I need to change the country code in the URL when I select the country from the dropdown. Currently I only have 3 countries in the dropdown, but when I switch from SG (testing.com/sg/features) to IE, the resulting URL becomes (testing.com/ie/sg/features). It works fine when I switch from IE(testing.com/ie/features) to SG(testing.com/sg/features) tho. <form name="form1"> <select class="region regionTopBar" onchange="formChanged(this);" name="country" size="1" style="font-family: inherit;

CSS :last-child AND :hover on an a link in a ul

夙愿已清 提交于 2021-01-07 03:26:33
问题 I'm styling the last child of a navigation menu which I seem to be able to do fine with the following code: .aston-menu-light ul > li:last-child { border:2px solid blue; border-radius: 50px; padding:0 20px 0 20px; } .aston-menu-light ul > li > ul > li:last-child { border:none !important; padding:0 !important; } .aston-menu-light ul > li:last-child:hover { background-color:#ffff; -webkit-transition: all .5s; -o-transition: all .5s; transition: all .5s; } The trouble comes when I try and target