HTML Element Selectors In JavaScript | JavaScript Tutorial In Hindi #14
HTML-код
- Опубликовано: 7 сен 2024
- ►JavaScript Tutorial For Beginners In Hindi Playlist - • JavaScript Tutorials I...
►Source Code + Other Material - codewithharry....
This video is a part of my JavaScript In Hindi Course. JavaScript is a high-level, interpreted programming language that conforms to the ECMAScript specification. JavaScript has dynamic typing, prototype-based object-orientation, and first-class functions.
Alongside HTML and CSS, JavaScript is one of the best and most demanded technologies of the World Wide Web. JavaScript enables interactive web pages and is a crucial part of web applications. The vast majority of sites use it, and major web browsers have a dedicated JavaScript engine in order to execute it.
As a multi-paradigm language, it supports event-driven, functional, and imperative programming fashion. It has APIs for dealing with text, arrays, regular expressions, and the DOM, but the language itself does not include any I/O, such as networking, storage, or graphics facilities. It relies upon the host machine environment in which it is embedded to provide these features.
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Learn Python In Hindi ...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithha...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
I have completed C, Html, CSS, and Js in one video as well. you have cleared all my doubts. Thankyou.
kuch zyada nahi hua
@@ajazamin9843 She is Papa ki Pari .She can do Anything😂😂😂😂
@@DTPHAMANKUMAR 😂😂
good
I must say that this JavaScript playlist is the best, we are really lucky that we are having this content for free, and from the great dev like you sir, I have tried many courses and institutes like Aptech but what you are teaching is more advanced and understandable just because of your teaching styles and hard work, I'm thanking you from the bottom of my heart for everything you have given to us, highly grateful to you and I appreciate your efforts, may God always keep you in his shelter where you keep achieving the success and may your good dreams and wishes come true.
Kinds regards
Danishraj
love from Pakistan
love you : )
4:00 if anyone is getting their result as null, just to one simple thing. Cut this from header and past it just above . Your problem will be solved ;). Because when we put in the header the JS code gets loaded pretty quickly it may be not ready at that time, and by keeping it just above the JS code will get pretty much time to get proper load and our problem will get resolved.
thanks bro I was stuck their i really appriciated you
thanks bro for the help
you're a saviour bro...
Thank you brother
Thanks Man, You gained my respect :D
great explanation of the element selector ....
May you live long i love your teaching style. Love you😘😘😘😙😙
harry you are really amazing man your teaching style is soo nice thanqq for teaching us :-)
good
best teacher ever.....
For Future Reference:
let element = document.getElementById("myfirst");
element.className;
element.childNodes;
element.parentNode;
element.style.color="red";
element.innerText="Harry is a good boy";
element.innerHTML="Harry is a good boy";
let sel = document.querySelector('#myfirst');
document.querySelector('.child');
document.querySelector('div');
let elems = document.getElementsByClassName('child');
console.log(elems[0].getElementsByClassName('child'));
getElementsByTagName('div');
13:35 - converting HTML collection into Array
for style multiple element at once
let a;
a = document.querySelectorAll('.child');
Array.from(a).forEach(function (element) {
element.style.backgroundColor = 'black';
element.style.color = 'white';
})
Console.log bhul gye 😂😂😂
harry bhai it would be more better if have practice sheet in the tutorial as well
Thank you so much sir. your videos are really helpful, well explained and understandable .
Best teacher
Bhai please java ke tutorial le aao
Like jisko java ke tutorial chahiye
*Thanks.*
you cleared my doubts. You deserve more subscribers. Don't stop making tutorials.
When I select 'div' by queryselector('div') and then style it styles the entire texts in the 'div class =container' and it turns green and not just ' Welcome to code with harry'
That is because if you notice carefully, the html that harry created in the video has one div inside the body which the first div. All the h1 and other contents are inside that div. Now since document.querySelector('div') targets the first div in the document, therefore all other items also turn green because they are all contained inside the first div.
Hope this helped!
Happy Coding!
@@FlashGaming2018
Thank you yeah I got it after rewatching video ..
Thanks for your response..
In the line number 23 --- "When you enter sel.style.color ='green' " not only heading is green childs are also green but why ? as we are reading single line selector
thank you sir... love uh..
hello bhai
sir how to make money step by step after seeing your videos . thoda roadmap dijie Please
Thanks sir
hello bhai
Uncaught TypeError: Cannot read property 'style' of undefined
Bro use ` this symbol and work only on div
Can uh plz explain properly its still showing uncaught error
cut the script tag and paste it just above the closing body tag. It will work
I am truly saying that you are the best !!!!
we can use loops to print the elements
Harry Bro please python Django API's ke uppar video series banao please and thanks for this wonderful tutorials.....
Ho sake to please reply karna ....
Really you made it easy man !
Thank You Harry Bhai!!!
Failed to load resource: the server responded with a status of 404 (Not Found)
pls help me with this error i have my files connected properly.
Thanks, bro..
What is the difference between document.getElementById and document.write
I am having different outputs when using this on loops
Thanx Harry
just masterpiece
hatts off harry bhai..... keepit up
love from pakistan
Excellent explanation, big fan!!
you are great bro
need help,
I am creating a table, I want to show the table, and from each row, there will be a edit button, so how to use that edit button in each row, for different person's data.
how to do undefined table's getElement, I mean please help
Very interesting video...thanks Harry Bhai
keep selected dependent dropdown by database after submit
document.querySelector('.someid') giving me null in console but if i am using class name after dot it is giving me that element in console and getting same result with #someClsName
What is the difference between parentElement and parentNode?
console.log(document.getElementById("child1").parentNode, "parent node");
console.log(document.getElementById("child1").parentElement, "parent element");
Array.from(document.body.getElementsByTagName("p")).forEach(function(ele){console.log(ele.innerText)})
Harry is very GOOD boy
05:16 sir why you had same div with two ids first id = 'myfirst' and then id = 'first' its confusing.
Sir koe website bta dein jahan sy humein sare properties mil jaen you told in this video.
Code with Harry website
Thank you very much bhai
hi harrybhai
Uncaught TypeError: Cannot read properties of null (reading 'style')
Very helpful video 👍
Sir please node is ke bhi tutorial banaiye please
I have only one script tag in my html file. But document.scripts is consoling that I have 2 scripts ? Why ?
Thank you bhai ❤️
My Method is Different. I found it when i spend hours so please chech it out -
// This will Give me link which contains text "Abhishek" inside 'href' attribute in 'anchor tag'.
let myText = "Abhishek";
for (let i = 0; i < document.links.length; i++) {
let myLink = document.getElementsByTagName("a")[i].getAttribute("href");
let boolVar = a.includes(myText);
if (boolVar) {
console.log(myLink);
};
};
During finding solutions i found difference between .innerHTML and .outerHTML-
1)innerHTML : HTML inside the selected element. Only content inside tag.
2)outerHTML : HTML inside the selected Element + HTML of the selected element. Including Tags and Attributes.
Sir when i use let it gives unexpected identifier error and when i use const it doesn't give ??
any one can explain me why we use JavaScript to change things in our css? we can change it directly from our css?? why we use this selector to change our css??
thank you so much sir
Sir mere laptop may query. Selector nahi chll raha baar baar error show krr raha hai can you tell me about problem of solution
Great hai Sir
thank you brother
Amazing explanation
sir g yha tak ham chezen dakhi but ye smjh nai arha k ye web main inak kia use ha
Why i get this error [HTTP/1.1 404 Not Found 0ms]??
Thank you 💝
Excellent video
let element =document.getElementById("print").innerText="Email format is matched";
element.style.color="pink";
css is not working why???color of text is no changed when i used above code
try element.style.color='red' (not red)
You are the best teacher
Harry Sir
i am not getting output in console after writing
let element = document.getElementById('myfirst');
console.log(element);
O/p in console is 'null'
why is this happening?
if you know please let me know
yes i have already created 'myfirst' id in html file
Use myFirst instead of myfirst.
Luv uh bruh😘😍
document.querySelectorAll(); yeeh wala bhi toha hae nah ??
How to use childnodes
Uncaught TypeError: Cannot read property 'style' of undefined
please tell about this
same problem with me !
Use window.onload= function() {
Your code
}
This will solve your problem. It was happening with me too.
put , before tag
*Thanks *
Done done again
Good explained I.A.Siddiqui Karachi
Useful lecture
let element = document .getElementById("myfirst");
->>> it returning null value. why?
mila bhai solution ?? mera bhi yhi aaa rha hai
Please make a video about bash ...sehll language
thankuu. Meoww
Hiii sirr I am getting this error while running the javascript code in the console
Tut16.js:41 Uncaught TypeError: Cannot read property 'getElementsByClassName' of undefined
at Tut16.js:41
put , before tag
Awesome video
I would like to see you on Sundeep maheshwari stage..
Tq sir...
now getting interested
How to change inner html content dynamicaly
Why is mine showing undefined in the console .. please reply
show me the code
@@sagarhaldar7559 done bhai 😊 but I need to using the console itself and not the text editor 😊Thanks for the concern
bhai...jab v mein document.getelementbyId(myfirst); likhta hun tab console mein *null* show kyun kqr raha h?
myfirst ko quotes m likho
Sometimes application need some time interval to load webpage,
Please follow below code,
setTimeout(function(){
let element = document.getElementById('myfirst');
console.log(element);
}, 2000);
Hope it should work for all !!
@@godupliftsyou5426 it worked bro thank you so much!!!
@@godupliftsyou5426 But Why Bro ? Why we can not use only document.getElementById('something');
solution vdo kahan hai?
Best Bro
as a non css user, it was really hard to understand this tutorial.
Harry bhai getelementbyid ki output null aa raha hai
Plz solution 🙏🙏
Btw video is fantastic
script ko head m add maat kro body m kro nhi ayega null
Bhaii live server nahi chal Raha hai .js file mein
love to learn
Nice video
Sir xampp use nhi ho pa rha h uski vjah se mai aage Ka kaam nhi kr pa rha hu kya kru
Sir what do u mean from access the playlist?
Dekho pura playlist, bass
kehna kya chahte ho
😮
where can i find practice questions?
harry bhai itni language ati h apko or apse syntex bhi mix nhi hote kyu?
Sir plz make c++
Jo bhi bolo Bhai thumbnail har series ka mast banate hi
exactly ✌️
sir whenever i am typing let element = document.getElementById("myfirst"); it showing null in console why????
koi problem hoga typing me
id me myfirst ka synatx check kar lo
I also faced the same problem and could not get what is the problem is. And I’m gonna make sure that there were no typing or syntax errors but the problem is not fixed. Does anyone have any suggestions regarding THIS issue?
"myfirst" ko "myFirst" try...reply if it solves the problem...
let element = document.getElementById("myFirst");
console.log(element);
ye karlo , fir ayega sab kuch..
put , before tag
nice
sel= document.querySelector('div');
sel.style.color= 'cyan';
console.log(sel);
aisa krne pe mere baki div ke v color change ho rhe hain.
sir please meko thoda clear kre qki jb aap v kr rhe ho toh usme v baki div ke v color change ho rhe hain .
@@anjalimoon619 exactly same question here, did you get the answer please reply.
All turns green
@@bhavingadhiya3844 becoz all the div is inside the
@@anjalimoon619 becoz all the div is inside the
document.getelementbyclassname and queryselector me kya diffrence hai ?
when i am use element selector it show null in console what is this error can you help me
Hey Bro Same problem with me if you have any solution then please tell me ?
@@jaydesai1176 I found this solution use Javascript tag in bottom line before head element