Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

add a class to font inside a div with a class using jquery

I have following html rendered in power portals and it is causing to break the formating of the input group.

<div class="control">
    <div class="input-group" role="none">
       <font size="3" style="position: relative;">
          <input name="ctl00$ContentContainer$WebFormControl_3596f2cdce74ec11894300224812"....>
       </font>
    </div>
<div>

I have tried adjusting in dev tools and if I found that if apply a class of "input-group" to the font attribute everything formats nicely if it is like below.

 <font size="3" class="input-group" style="position: relative;"></font>

I am not sure how to find the font attribute in dom using jQuery.
I have tried this below but it seems to not do anything

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

$(document).ready(function () {
$('#WebFormPanel').each(function(e) {
    let divinputgroup = $(this).find("input-group");
         if(divinputgroup.length){
            $("font").addClass("input-group");
         }
    })
 });

>Solution :

   $(document).ready(function () {
$('#WebFormPanel').each(function(e) {
    let divinputgroup = $(this).find(".input-group");
         if(divinputgroup.length){
            $("font").addClass("input-group");
         }
      })
  });

You can use this and also you can give class to font, so that it can be use easily

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading