JavaScript Tutorial for Beginners - 37 - Creating a new element Part 2

preview_player
Показать описание
JavaScript Tutorial for Beginners - 37 - Creating a new element Part 2

In this video we will create a heading element for our new section.

JavaScript, Document Object Model, dom, beginner, JavaScript Tutorial for Beginners, Introduction to

JavaScript,
programming, webpage, events
Рекомендации по теме
Комментарии
Автор

Definetely the best educator in youtube. Thank you sir.

blackbrother
Автор

Why are you js videos so I can not stop watching them even when I am having dinner :) :)

kamal-ahmed
Автор

to anyone currently watching, you can disappear the button once you press it by getting the id of the button and setting style display to none in the same function

moisessoto
Автор

Great lessons, as always. How can I create a NewParentNode - for a New Element ?! Can you explain it, sir, plese. Thank you. Regards

m.r.a.sandroidzone
Автор

Thanks for a excellent session😊. I have doubt - After clicking the button on webpage it creates a heading and para, if i click again its duplicating the same, how should i over come that scenario?

rvcookingstories
Автор

Does "j.s" know that the Heading will be added in between the paragraphs? Is this an automatic feature in the DOM? - thanks ej!

jeremiahvaliente
Автор

@ EJ Media. I just wanted to say that we dont have the "Creating a new element Part 1 video" ive been following your videos closely and i havent created a new element at the bottom that says "click if you wana read about another battle". i double checked, theres no video for that lol. i hope you still check on these comments oh well

wait.... crap! this video just started playing right after the CSS layout series number 23 dammit. i was like when did we come to JS tutorial grrr

kieran
Автор

How do you get the new elements to also get the class attributes of the old ones. My new created elements don't have the class attributes of the first one.

yousufdaramay
Автор

Hello EJ. How to stop creating the same para when you hit the button again. Thanks

tryagain
Автор

im sorry, but battle of the salamis? (as in meat)



btw: im kidding great video

sarah
Автор

Why we are not creating a variable for introducing body element to JavaScript??
And also if I m creating a new function to add new 'div' element under the parent element 'body' it is not working..why???

sweetyagarwal
Автор

Hi EJ whenever i am creating an element, it creates, elements kept creating as many time user is clicking the button, how to disable it to one time, can you please give some clues

AdvJagvirSinghSorout
Автор

Can anyone help me please? My query is that in this video we add a heading. This heading become red colour . But we do not add any code to make it red. Without adding code how it turns red. If I want to change it what is the process. TIA

chowdhuryazizul
Автор

How do we please operate the click only once because when I clicked again the text repeatedly appeared. Thank you

johabib
Автор

Me again :D
Every time i click the button again the button creates the same heading and paragraph again. That should happen ?

franjokeskic
Автор

Wait a time I click that button the paragraph keeps on adding and adding and adding and fill the shoud I do about it.??
please reply

ikushum
Автор

doesnt work
html:
<!DOCTYPE html>
<html>
<head>
<title>h</title>
<script src="jscode.js"></script>
<link rel="shortcut icon" href="favicon.jpg">
</head>
<body>
<button onclick="elem()">New paragraph</button>
</body>
</html>
js:

function elem() {

var element = document.createElement("p");

var text = document.createTextNode("The Battle of Salamis was fought between an alliance of Greek cities and the Persian Empire in 480 BC. The Greeks decisively defeated the Persian navy.");

element.appendChild(text);

}

tastyl