List of top digital marketing companies in chennai for DOM query selector

List of top digital marketing companies in chennai for DOM query selector


  1. DOM query Selector Introduction

That is a different way to grab elements and then you erase some of this code and some more use in terms of say CSA selectors and just for a quick rundown of CSA selectors CSSA is basically used to grab parts of your Eastern melon style. Right. So we have a div here Stiv and we want to have a bunch of text in here and some top digital marketing companies in chennai with dummy text you can write CSSA to grab anything inside div tags for example and show that we can use inline style tags.

2. Nomenculture

Or rather we can do inline styling just by doing a style here style and style. This is one way you could also just go to the CSA tab in Jaspan. But if you want it to grab for example this div Well the CSSA would look like this digital agency 2019. You grab the div fire the selector and then you can apply CSSA to it. For example, if we wanted to colour all this text red we could do it like this.


Now if we refresh this page and we give it a second to load up we've applied some styling to this text. You could say top digital marketing companies in chennai something like font size hundred pixels. And this is just really kind of your bog standard CSSA type stuff and you can use what's called a query selector in terms of the dorm API to grab any CSA selector as you would say in a style tag. And what that would look like is you could say Konst my div, for example, equals document dot query selector.

3. Main Keywords to focus

Maybe the emphasis should be query selector but in any case, you can just input like I'm doing here in my style tag you can grab a div and now if we can solve that. Let's take a look at what it looks like in the consul so we'll refresh this and I'll open up my dev tools again option command. If you're on a Mac you can see that top digital marketing companies in chennai it's just a div it returned to us. This node essentially as if we were grabbing it by the ID. Now we can run some kind of logic on it. And we can even do kind of styling via the dorm API as well. So if we did my div Daut style and in fact, you know let's Consolo that first console log my div style.

4. Inline Styline

Let's see what style is being applied to this div I'm a dev tool, yes a style declaration pretty interesting stuff going on here. That we can actually set properties here as well. So let's do that in my div style dark colour. Equals Let's see what happens. Refresh. And we have now styled it using javascript. Isn't that interesting. So we kind of top digital marketing companies in chennai overrode the style we did in our style tag but you know what. It worked. And again if we inspect this. Let's take a look at the elements and we can see that what it did was it did what's called inline styling here which is definitely an option when you're doing each mouse and sort of doing like an external style sheet.


So here we just sit in line in terms of the style attacks instead what the dog did was it grabbed this declaration and it created this style tag for us style equals colour green So that's pretty cool and we can see that in our styles over here. This is crossed out because it's being overwritten by are inline style so inline styles here take precedence over any externally declared styles like this one is top digital marketing companies in chennai with CSA selector as you would say in a style tag. And what that would look like is you could say Konst my div, for example, equals document dot query selector.


6. Query Selection

a. Maybe the emphasis should be query selector but in any case, you can just input like I'm doing here in my style tag you can grab a div and now if we can solve that. Let's take a look at what it looks like in the consul so we'll refresh this and I'll open up my dev tools again option command. If you're on a Mac you can see that it's just a div it returned to us. This node essentially as if we were grabbing it by the ID. Now we can run some kind top digital marketing companies in chennai of logic on it. And we can even do kind of styling via the dorm API as well. So if we did my div Daut style and in fact, you know let's Consolo that first console log my div style. Let's see what style is being applied to this div I'm a dev tool, yes a style declaration pretty interesting stuff going on here.


b. That we can actually set properties here as well. That's why it's crossed out in the dev tools. If you're ever wondering you're looking at this and you're saying hey how can some of my CSSA is crossed out. Well, it's probably being overridden somewhere top digital marketing companies in chennai I would say my div style Daut font size. Notice it kind of uses Javascript style camel case and font size equals pixels. Kind of like we saw previously and will refresh this and reload it this way. If that's something you want to do but you can look at it and it looks like it did apply those styles for us. And again we inspect and we can already tell that it's planning it's pretty clear that it's applying it but we can see that it's just doing inline styles for us. Pretty cool stuff.



Report Page