How can i call jquery in katalon to change the DOM element

i am trying to set a new data value of a custom attribute of a div using attr() while going through the enter link description here ,i found out it can be done using .attr( attributeName, value )

I have a requirement where in i want to change attribute value of DOM before a particular ajax call.Now how can i call this jquery in katalon to change the DOM element.

I am trying to implement below solution in katalon enter link description here

Hi Tarun das,

I did it by introducing custom keywords,
I send the TestObject, the attributeName and the “to be” attributeValue as parameter to the method and run a javascriptExecutor to get this working, see below:

import org.openqa.selenium.JavascriptExecutor
@Keyword
def changeAttributeValue(TestObject objectToBeClicked, String attributeName, String attributeValue) {
String objectID= objectToBeClicked.getObjectId()
String pathvalue= objectToBeClicked.findPropertyValue("id")
WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) DriverFactory.getWebDriver();
js.executeScript("document.getElementById('" + objectID + "').setAttribute('" + attributeName + "', '" + attributeValue + "')");
}