Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][HTML]Pobieranie href dla <a>
-Gość-
post
Post #1





Goście







  1. <a class="klasa" href="link">costam</a>


jak javascriptem pobrać link kryjący się pod href ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
matino
post
Post #2





Grupa: Zarejestrowani
Postów: 175
Pomógł: 30
Dołączył: 9.08.2007

Ostrzeżenie: (0%)
-----


  1. var links = document.getElementsByTagName('a');
  2. for (var i = 0; i < links.length; i++)
  3. {
  4. if (links[i].href == 'link')
  5. {
  6. // Twój kod tutaj
  7. }
  8. }
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 7.10.2025 - 07:58