'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

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


Solution 1:[1]

   $(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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ruchi Sharma