It's much easier to show the Javascript code than offer a complex explanation:
var html = '<input tabindex="1" type="text">';
html.replace(/tabindex="([0-9]+)"/g, 'tabindex="' + ("$1" * i) + '"');
In this code, "$1" will always be a string, meaning this RegExp will always result in 'tabindex="NaN"' ... Using parseInt doesn't work.
Is it possible to cast the response from the RegExp as an integer so I can perform maths on the replacement?