JQuery insert/replace weirdness on <br>

Developer
Size
2,619 Kb
Views
48,576

How do I make an jquery insert/replace weirdness on <br>?

What is a jquery insert/replace weirdness on <br>? How do you make a jquery insert/replace weirdness on <br>? This script and codes were developed by Chris Holder on 20 June 2022, Monday.

JQuery insert/replace weirdness on <br> Previews

JQuery insert/replace weirdness on <br> - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery insert/replace weirdness on <br></title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { text-align: center;
}
span { background: #aaa; padding: 1em; line-height: 3.5;
}
.should-be-like-this { margin-top: 100px;
}
a { display: inline-block; margin-top: 100px; padding: 1em; border-radius: 4px; background: #1E8CBE; color: white; text-decoration: none;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <!-- I want to add a </span> before the <br> and <span> after the <br> -->
<h2 class="cool-headline"><span>this<br>won't work</span></h2>
<h2 class="should-be-like-this"><span>should be</span><br><span>like this</span></h2>
<a href="http://codepen.io/jackrugile/pen/MYqWdL">Thanks to Jack for a solution ❯❯</a> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

JQuery insert/replace weirdness on <br> - Script Codes CSS Codes

body { text-align: center;
}
span { background: #aaa; padding: 1em; line-height: 3.5;
}
.should-be-like-this { margin-top: 100px;
}
a { display: inline-block; margin-top: 100px; padding: 1em; border-radius: 4px; background: #1E8CBE; color: white; text-decoration: none;
}

JQuery insert/replace weirdness on <br> - Script Codes JS Codes

/* These all insert the spans in the wrong order and result in an empty span */ /* $( '.cool-headline br' ).before( '</span>' ).after(' <span>' ); */
$( '.cool-headline br' ).replaceWith( '</span><span>' );
/* $( '.cool-headline br' ).insertBefore('</span>').insertAfter( '<span>' ); */
JQuery insert/replace weirdness on <br> - Script Codes
JQuery insert/replace weirdness on <br> - Script Codes
Home Page Home
Developer Chris Holder
Username see8ch
Uploaded June 20, 2022
Rating 3
Size 2,619 Kb
Views 48,576
Do you need developer help for JQuery insert/replace weirdness on <br>?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Holder (see8ch) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!