02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Understanding HTML Insert and Delete Tags: del, s and ins

Know how some sites have a line through there content or updates of things that changed. In this session we will learn how that is achieved.

Video Transcript

00:00-Alright Ma' are you ready for your next badge of HTML tags?
00:03-yeah
00:03So while you weren't here I've added a new paragraph, a new H2 title 'cool HTML tip'
00:12and added a new tips saying that XML E4X is part of W3CHTML5 specs
00:18and you're probably thinking : that is really cool,
00:24-sure it is
00:25Don't worry, it's cool for a geek
00:28so actually updates, because HTML5 is still being created and spec'ed out,
00:34E4X is not part of the specs anymore, you already know it's not but you eally don't want to delete your page really
00:41-Sometimes a tax form,
00:43Sometimes it does. It's not part of E4X specs anymore, so you kind of want to just put a line through it
00:54and say: well this isn't really a cool tip anymore or ignore that but you don't want to delete it
00:58because you want to still be search and search engine, so someone finds out information useful
01:03it'll still be able to see it, you just don't want to delete anything you've created already,
01:08and we're going to learn 3 attributes right now:
01:10'del' an 'ins' and 's'
01:13so let's start with del. Del enables you to specify that text just deleted, for example
01:20this scenario maybe 'XML E4X' we could strike it through and maybe say 'delete'
01:27this is just not true anymore, so we're going to delete this element telling the browser:
01:31'well, we kind of changed our mind, this isn't really accurate'
01:34very common inf you're posting on the blog and you find out you posted something that was stupid
01:39but thousands of people already saw it so you could go right in there and just line through it
01:44and maybe put a comment and explain the real answer,
01:47People make mistakes, even book writers or video makers - too many mistakes,
01:54and we're happy that you send us emails about them,
02:02With that said, let's click on refresh and you'll see that now there's a line striking through
02:06or deleting the copy, basically it's still there, people can still read it but they can see that
02:11this copy is not really relevant anymore and it's very intuitive to understand that it's not
02:16-That's like when they have a sale and it's marked down...
02:20-yeah exactly, they have like 4.99 , 'no! actually not! it's 49$!' like we do a lot of times
02:27as we have great sales if you're part of our newsletter, very good point ma'
02:33By the way that pamphlet you got was our pamphlet? -no!
02:38ah okay so let's not talk about that anymore then.
02:46How about we delete that but we'll insert a new copy inside. Now the answer doesn't have any visual...
02:52doesn't really show you anything but it's good for the browser to know that you just updated,
02:57the less so for the users. So the users wouldn't know that you just inserted it but the browser definitely would
03:04so you could strike that in, we striked out XML E4X and we could say that the canvas
03:09because the canvas is a a part of WC3HTML5 specs and we actually teach about it
03:14and you could find that at 02geek.com
03:17and if we click on refresh you'll see that now we have 'canvas is a part of W3CHTML5 specs'
03:23there's a line through UNDERNEATH it
03:24but it doesn't really indicate to users that this is a new copy but at least it makes it more important,
03:29and that's something you could control and change the visuals of
03:33if you knew... ?
03:39-if you knew... HTML S? -CSS!
03:43-oh CSS! sorry,
03:45if you knew... ? -CSS
03:49if you knew CSS you could have gone inside and change the way it appeared and looked like,
03:53so there's the 's' tag also, we did the 'del' tag there's also another one that's called 's'
03:57that basically does the same thing so maybe this isn't cool anymore so I want to delete this whole line
04:02of 'cool HTML tips' because it's just not cool. I could go inside and let's first see how we do it,
04:07and then we could basically strike through it by putting here an 's' , closing it down
04:13and by the way 's' was deprecated in HTML4 meaning that HTML4 asked to not to use it anymore
04:19but in HTML5 it was reintroduced but it got a new meaning, so if you look here and refresh it
04:26now in the specs basically it says that if you are striking something out to it and search something else instead
04:32then you'll use 'delete' the 'del' attribute, like we did here, we're replacing XML E4X with 'canvas'
04:38so we're using the 'del' and inserting
04:40But in the case when we're just marking something out and say: this is completely not correct,
04:43and we're not trying to put anything new inside then we'll probably use the 's'
04:47The schematics between two don't really matter too much, I'd say just stick to 'del' but you know...
04:54-no, some may want to strike something out and not renew the ideas so..
04:59-yeah I guess, yeah. There is some value to it I guess.
05:04But it's not something that is very common so I'd say keep this video in your library
05:08and if you ever get to the scenario where you need to do this and just make sure that you checked video again
05:13to refresh your memory.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!