Skip to content

leighwhite96/research-and-problem-solving-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Questions

Using JavaScript how would you solve these problems?

REMEMBER: You can do anything with code, you just need to think of what you need to do, google it, and implement that code into your solution

  1. How do you get an element's ID

                                            document.getElementById('id').id
    
  2. How do you create a h1 tag

                                            document.createElement('h1')
    
  3. How do you add a class to an element

           This is if there's already a class.... 
       Add an ID to your element to make it easier to select. document.getElementById("div1").className += " otherclass";
    
  4. How do you add some text inside of an element

                                             element.innerHTML = "text"
    
  5. How do you create a paragraph tag

                                             document.createElement('p')
    
  6. How do you remove the child of an element

                                            document.removeChild(element)
    
  7. How do you get the value entered in an "input" area

                           Give the text input an ID (<text area>) then document.getElementById("id").value;
    
  8. How do you set an elements attribute

                                        element.setAttribute(attribute, value)
    
  9. How do you change the style of an element to display:none

                                            element.style.display = "none"
    
  10. How would you change a value for a:hover

                                            a:hover.style.value = "value"
    

About

Problem solving task, use js to solve

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published