Advertisement
sanjiisan

Untitled

May 14th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. /**
  2. * Created by Jacek on 2016-01-11.
  3. */
  4.  
  5. document.addEventListener("DOMContentLoaded", function () {
  6. // var allElements = document.querySelectorAll('li');
  7. // var elements = document.querySelectorAll('li:not([data-direction])');
  8. //
  9. // for (var i = 0; i < elements.length; i++) {
  10. // elements[i].dataset.direction = 'up';//opcja 1
  11. // elements[i].setAttribute('data-direction', 'up');//opcja 2
  12. // }
  13. //
  14. // for (var i = 0; i < allElements.length; i++) {
  15. // if (i % 2 === 0) {
  16. // allElements[i].style.backgroundColor = 'green';
  17. // }
  18. // }
  19. //
  20. // document.querySelector('ul li:nth-child(5)').classList.add('big');
  21. // ///
  22. // var nthChild = document.querySelectorAll('ul li:nth-child(3n)');
  23. //
  24. // for (var i = 0; i < nthChild.length; i++) {
  25. // nthChild[i].style.textDecoration = 'underline';
  26. // }
  27. // ////////
  28. //
  29. // var optionElements = document.querySelectorAll('option');
  30. //
  31. // for (var i = 0; i < optionElements.length; i++) {
  32. // var val = optionElements[i].getAttribute('value');
  33. // optionElements[i].innerText = val;
  34. //
  35. //
  36. // optionElements[i].dataset.year = parseInt(val) + 20;
  37. // }
  38. //////////
  39.  
  40.  
  41. var chrome = document.querySelector('.chrome');
  42. chrome.style.width = '100px';
  43. console.log(chrome);
  44.  
  45. var edge = document.querySelector('.edge');
  46. edge.style.backgroundImage = 'url("assets/img/edge.png")';
  47. console.log(edge);
  48.  
  49.  
  50. var ff = document.querySelector('.firefox');
  51. ff.style.backgroundImage = 'url("assets/img/firefox.png")';
  52. console.log(ff);
  53.  
  54. //
  55. var edge = document.querySelector('[href="www.github.pl"]')
  56.  
  57. edge.setAttribute('href', 'https://www.microsoft.com/pl-pl/windows/microsoft-edge');
  58. edge.innerText = 'Edge';
  59.  
  60.  
  61. var firefox = document.querySelector('[href="www.coderslab.pl"]')
  62.  
  63. firefox.setAttribute('href', 'https://www.mozilla.org/pl/firefox/new/?utm_source=google&utm_medium=paidsearch&utm_campaign=Firefox-Brand-PL-TS-GGL-Exact&utm_term=firefox&utm_content=A144_A203_A006327&gclid=Cj0KEQjwgODIBRCEqfv60eq65ogBEiQA0ZC5-f7eMsCKgXh2QBaBmKSiN-E0aajaPaSUxWX9Ikz9FPsaAkPQ8P8HAQ&gclsrc=aw.ds');
  64.  
  65. firefox.innerText = 'Firefox';
  66. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement