Skip to Content
0
Sep 07, 2023 at 10:18 PM

How can I do this with custom Script Function in SAP Build ?

72 Views

// Find all <font> elements within the <td> element (assuming it's inside a <td>)

var tdElement = document.querySelector("td.alt1");

var fontElements = tdElement.querySelectorAll("font");

// Iterate through <font> elements

fontElements.forEach(function(fontElement) {

// Check if the font element meets certain conditions (e.g., font-weight, other attributes)

if (fontElement.style.fontWeight === 'bold') {

// Create a mouse click event

var clickEvent = new MouseEvent('click', {

bubbles: true,

cancelable: true,

view: window

});

// Dispatch the click event on the <font> element

fontElement.dispatchEvent(clickEvent);

}

});

Its my first time trying to write a custom script and I am very new to this please help!