JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<input type="text" name="j_username" id="j_username" autocorrect="off" autocapitalize="off" style="background-image: linear-gradient(rgba(255, 255, 255, 0) 96%, rgb(41, 140, 196) 4%); background-position: 0px 0px; background-repeat: no-repeat;">
<input type="password" name="j_password" id='j_password'>

JavaScript

$('#j_username').each(function() {
  $.each(this.attributes, function() {
    if(this.specified) {
      var name = this.name;
      var value = this.value;
      var flag = 0;
      $('#j_password').each(function() {
        $.each(this.attributes, function() {
          if(this.specified) {
          	if(this.name == name) {
            	flag = 1;
            }
          }
        });
        if (flag == 0) {
        	$('#j_password').attr(name, value);
        }
      });
    }
  });
});