Сообщение от Vaska
|
как между тегами <td> убрать теги <p>?
Между тегами <p>есть текст</p>. Нужно, чтобы тест оставался на месте.
|
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
p{
background-color: hsla(0, 100%, 50%, 1);
color: hsla(0, 0%, 100%, 1);
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$("td p").replaceWith(function() {
return this.innerHTML
})
});
</script>
</head>
<body>
<p>123</p>
<table>
<tr>
<td><p>Test</p></td>
</tr>
<tr>
<td><p>Test2</p></td>
</tr>
</table>
<p>456</p>
</body>
</html>