When presented with the following HTML
<a onclick="lel($(this),'212345555')" class="button">
<a onclick="lel($(this),'241214370')" class="button">
<a onclick="lel($(this),'248916550')" class="button">
<a onclick="lel($(this),'253234444')" class="button">
<a onclick="lel($(this),'248914570')" class="button">
You have the option to extract and execute operations on these identifiers using regular expressions, with the help of the JavaScript code below
function gatherAndExecute() {
// Loop through each 'a.button' element that has an onclick attribute defined
$('a.button[onclick]').each(function(i, e) {
// Retrieve the value of the onclick attribute
var rawId = e.attributes['onclick'].value;
// Parse the identifier from the attribute
var id = rawId.match(/lel\(\$\(this\),'(\d+)'\)/)[1];
// Call the lel function
lel($(e), id);
});
}
You can also refer to this working example in a demo: https://jsfiddle.net/k9376p5c/
If possible, consider adding an id attribute to these elements while generating the HTML from your server to avoid the need for parsing identifiers.