+ 2
Hello World! I have a question about making custom tags...
• I wanna my new custom tags, and I wanna make the Javascript can read the text inside my tag, example, like <alert>Hello World</alert>... I wanna make it an alert saying "Hello World" or any word that I will put inside the tag... • I wanna make the Javascript can read the attributes inside my tag... Is it possible? Any help will be appreciated!😊 I'm currently thinking of making a <print></print> tag and any printing tags shouldn't work, just only <print></print> tag, I'm the one who is responsible for making that printing tags shouldn't work, just help me!😊
7 Réponses
+ 3
Hey there 大好き ,
I know that I'm a bit late, but I found a solution too.
https://code.sololearn.com/W1fh5c1UvHia/?ref=app
Hope it can be helpful :)
+ 2
Reading custom elements' content or attribute is one thing. But to make them spawn a JS alert box is something else.
If you want, you can use JS to map a certain event (e.g. click event) on those <alert> elements to trigger the alert box.
But if you mean to have the browser displays a JS alert box on finding the <alert> element while processing the document, I have no idea.
+ 2
Ipang Oh, thank you for the information!😊
Mirielle Yeah, that's what I mean😵😊
🇧🇩🇳🇴🇷'🇼🇪🇸🇹🇪🇷 Oh hey, thank you for the example! How do you get the letters inside the tag?😊 Well, I should inspect this!😵
+ 1
https://code.sololearn.com/WMQA8yiYK8so/?ref=app