static final String AB = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static SecureRandom rnd = new SecureRandom();
String randomString( int len ){
StringBuilder sb = new StringBuilder( len );
for( int i = 0; i < len; i++ )
sb.append( AB.charAt( rnd.nextInt(AB.length()) ) );
return sb.toString();
}
Я полностью изменил ваш код, потому что он нестабилен, и этот код решает все ваши проблемы.
HTML
<div class="card mb-2">
<div class="card-body">
<div class="card-text w-100 border rounded p-1 my-1">
<div class="form-actions">
<span class="control-label ml-2">Answer(s):</span>
<a class="btn btn-primary add_fields" href="#">Add Answer</a>
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="addon">
<div class="input-group-append">
<a class="btn btn-primary" href="#">
<svg id="addon" class="octicon octicon-trashcan svg-white" aria-label="remove" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg>
</a>
</div>
</div>
</div>
</div>
</div>
CSS
.svg-white{
fill:#fff;
}
Живой фрагмент
[ 114]
.svg-white{
fill:#fff;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<div class="card mb-2">
<div class="card-body">
<div class="card-text w-100 border rounded p-1 my-1">
<div class="form-actions">
<span class="control-label ml-2">Answer(s):</span>
<a class="btn btn-primary add_fields" href="#">Add Answer</a>
</div>
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="addon">
<div class="input-group-append">
<a class="btn btn-primary" href="#">
<svg id="addon" class="octicon octicon-trashcan svg-white" aria-label="remove" viewBox="0 0 12 16" version="1.1" width="12" height="16" role="img"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg>
</a>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>