16
Views
2
Comments
Solved
Dom manipulation
Question

Hello,

How to do dom manipulation.

how to change background colors, styles of particular element, Regex and many more using Javascript.

2022-12-22 10-00-39
Beatriz Sabino
Solution

Hello Shivani.

To change styles using JavaScript something like this can be used:

element.style.color = "white";  // Text color

element.style.fontSize = "20px";  // Font size


To change background color:

var element = document.getElementById("myElement");

element.style.backgroundColor = "lightblue";


To use Regex you can find more information here.


In Outsystems, on the OnReady event of a screen or block, use the JavaScript widget and add your necessary code.

Hope this helps!

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Shivani More ,

first answer : if you can do what you need without javascript, don't do it with javascript.

Only do this in cases where the platform doesn't provide a good option.  

There are many tutorials about using javascript in OutSystems.

Your question is hard to answer as it is not saying if this is reactive or traditional, and it has no detail of the exact problem you are trying to solve.

Dorine

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.