I am feeling quite perplexed at the moment, as I wonder if giving a duplicate attribute in attr() will only apply the last one. For example:
attr({style:'color:yellow',style:'font-family:arial',style:'color:yellow'})
. In this case, I have repeated the style attribute three times - will only the last one be applied? Is there a way to apply the second style instead?
<!DOCTYPE html>
<html>
<body>
<p id="prg1">first paragraph</p>
</body>
<script src="C:\Users\SUDARSHAN\Desktop\html_UI\jquery-3.6.0.js">
</script>
<script>
$('document').ready(function (){
$('#prg1').attr({style:'color:yellow',style:'font-family:arial',style:'color:yellow',style:'border-style:dotted'});
})
</script>
</html>