JavaScript javascript get images from list javascript images from folder,javascript images in array,javascript load

<ul class="">
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
</ul> 

i have good knowledge of jquery i know i can do it with that using children or find or directly..but i wana learn javascript and wana do it with js.. i want to select image tag from all the list but m unable to do it can you please explain in briefly.with that i wana learn js as soon as possible for job change can you help in that..

my tried code

var i;     
var parent = document.getElementById('right');
var lis = par.getElementsByTagName('p');
for(i=0;i<lis.length;i++){
//wat to do here

}
Answer:1

You need some changes like,

var i;
var parent = document.getElementById('right');
var lis = parent.children;
for (i = 0,l=lis.length; i < l; i++) {
  //wat to do here
  // getting alt for example
  console.log(lis[i].children[0].getAttribute('alt'));
}
<ul id="right">
  <li>
    <img src="" alt="1" />
  </li>
  <li>
    <img src="" alt="2" />
  </li>
  <li>
    <img src="" alt="3" />
  </li>
  <li>
    <img src="" alt="4" />
  </li>
  <li>
    <img src="" alt="5" />
  </li>
  <li>
    <img src="" alt="6" />
  </li>
  <li>
    <img src="" alt="7" />
  </li>
</ul>
Answer:2

html:

<ul class="parent">
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
    <li><img src="" alt=""/></li>
</ul>

js:

$element = document.querySelector('.parent');

var childs = $element.children;
for (var i = 1; i < childs.length - 1; i++)
{
        console.log(childs[i].querySelector('img'))
}
Answer:3

Running into a problem with the scrollmagic 'section wipes (natural)' activation. What I have in my wordpress theme: functions.php wp_enqueue_script( 'tweenmax' ); wp_enqueue_script( 'scrollMagic' );...

Running into a problem with the scrollmagic 'section wipes (natural)' activation. What I have in my wordpress theme: functions.php wp_enqueue_script( 'tweenmax' ); wp_enqueue_script( 'scrollMagic' );...

  1. canvas
  2. canada
  3. cancelled
  4. canceled vs cancelled
  5. cancun
  6. canada goose
  7. cane corso
  8. canes
  9. canadian prime minister
  10. cancun flights
  11. canker sore
  12. candy
  13. cancer
  14. canon
  15. canvas prints
  16. cancer sign
  17. candace owens
  18. canada news
  19. candytopia
  20. canlis

I just started to learn Angular ES6 way. I am analyzing this example from github: https://github.com/sitepoint-editors/Angular-ES6-BookShelf/blob/master/app/Controllers/HomeController.js And I tried ...

I just started to learn Angular ES6 way. I am analyzing this example from github: https://github.com/sitepoint-editors/Angular-ES6-BookShelf/blob/master/app/Controllers/HomeController.js And I tried ...

  1. angular inject function
  2. angular inject function into component
  3. angularjs inject function
  4. angularjs inject function into controller
  5. angular inject into function
  6. angular 2 inject function
  7. angular testing inject function
  8. angular 7 inject function
  9. angular dependency injection function
  10. angularjs inject into function
  11. angular inject service into function
  12. angular inject service in function
  13. angular export function inject service
  14. angular inject dependency into function
  15. angular injector dependency function

I'm trying to send a http request to a website and I need the user to fill out their names and mobile number. I'm trying to do it as followed (I'm still working on the validate function so right now ...

I'm trying to send a http request to a website and I need the user to fill out their names and mobile number. I'm trying to do it as followed (I'm still working on the validate function so right now ...

  1. html input values
  2. html input values array
  3. html input value code
  4. html input multiple values
  5. html input autocomplete values
  6. html input multiple values array
  7. html calculate input values
  8. html input type values
  9. html input 2 values
  10. html input two values
  11. html sum input values
  12. html input checkbox values
  13. html input default values
  14. html input predefined values
  15. html form input values
  16. html input keep values
  17. read html input values c#
  18. html input range values
  19. html input limit values
  20. html multiply input values

I have a few divs that share the same class. I have a dropdown that changes the background color of one of those divs when selected(option 2 changes div #2). My question is how can I change the ...

I have a few divs that share the same class. I have a dropdown that changes the background color of one of those divs when selected(option 2 changes div #2). My question is how can I change the ...

  1. find which element has focus
  2. find which element is scrolling
  3. find which element is clicked jquery
  4. find which element python
  5. find out which element you are
  6. jquery find which element is focused
  7. jquery find which element is visible
  8. find element in list python
  9. find_element_by_xpath
  10. find element in array javascript
  11. find element in vector c++
  12. find_element_by_css_selector
  13. find_element_by_class_name
  14. find element by xpath selenium python
  15. find element by class
  16. find element in array python
  17. find_element_by_id
  18. find_element_by_link_text
  19. find element jquery
  20. find element by class selenium