I want to replace the content from a tag in CSS via jQuery.
In this case the content "My content" to "New Content".
I have this CSS code :
a.appari:focus:after{
background: #333;
background: rgba(0,0,0,.8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: "My content";
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 400px;
}
I tried this jQuery code :
function prova() {
{
?>
<script>
(function($){
$(document).ready(function(){
$('.appari').click(function(){
$("<style>.appari:focus:after { content: 'New Content'; }</style>").appendTo( "head" )
});
});
})(jQuery);
</script>
<?php
}
}
Thanks for helping.