Legacy String Strategies for Producing HTML


I am all the time actually excited to see new strategies on JavaScript primitives. These additions are acknowledgement that the language must evolve and that we’re doing thrilling new issues. That being stated, I one way or the other simply found some legacy String strategies that you just in all probability should not use however have existed perpetually. Let’s have a look!

These legacy string strategies take a fundamental string of textual content and wrap it in a HTML tag of the identical identify:

"Good day".huge() // "<huge>Good day</huge>"
"Good day".blink() // "<blink>Good day</blink>"
"Good day".daring() // "<b>Good day</b>"
"Good day".italics() // "<i>Good day</i>"
"Good day".hyperlink("https://davidwalsh.identify") // "<a href="https://davidwalsh.identify">Good day</a>"

Native prototypes do not normally take away strategies and for good cause — they’ll break web sites! I am shocked I did not learn about these strategies earlier than in the present day. It is all the time enjoyable to see relics of the online previous although!

  • CSS Filters

    CSS filter help lately landed inside WebKit nightlies. CSS filters present a way for modifying the rendering of a fundamental DOM aspect, picture, or video. CSS filters enable for blurring, warping, and modifying the colour depth of parts. Let’s have…

  • Designing for Simplicity

    Earlier than we get began, it is value me spending a short second introducing myself to you. My identify is Mark (or @integralist if Twitter occurs to be your communication software of alternative) and I presently work for BBC Information in London England as a principal engineer/tech…

  • Parallax Sound Waves Animating on Scroll

    Scrolling animations are enjoyable. They’re enjoyable to create and enjoyable to make use of. If you’re uninterested in bootstrapping you would possibly discover taking part in with scrolling animations as a pleasant juicy refreshment in your dry front-end improvement profession. Let’s take a look tips on how to create animating…

  • Create Keyboard Shortcuts with Mousetrap

    A number of the most interesting elements of internet apps are hidden within the little issues.  These “small particulars” can typically add as much as huge, huge good points.  A type of small good points will be present in keyboard shortcuts.  Superior internet apps like Gmail and GitHub use a great deal of…



Source_link

Leave a Reply

Your email address will not be published.