var str = '<input style="background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTR2VDVmOQ8AKjqY1bMHgCGYXhFchnAg6omJGcBXEZRtNoXYK2dMsaMt1qtD9/3p40x5yS9tHI6o1wuz1lrVzpWXLDWTg3pz/0CQnd2Jos49xUAAAAASUVORK5CYII="); background-repeat: no-repeat; background-attachment: scroll; background-position: right center; cursor: auto; outline: 1px solid blue;" autocomplete="email" class="mat-input-element mat-form-field-autofill-control mat-input-server ng-untouched ng-pristine ng-invalid" matinput="" name="email" required="" id="mat-input-112621" placeholder="E-mail Address" aria-invalid="false" aria-required="true" value="" type="email">'
how do i return id="mat-input-112621" from this string, all that html code will be a string so just trying to return the id.
var id = str.substring(591, 608);. Otherwise you may use a regex, or a simple search. It all depends on what the rest of the string may be. This question doesn't contain enough detail to answer it properly.var id = 'mat-input-112621'?