Quantcast
Channel: OutSystems Community
Viewing all articles
Browse latest Browse all 1476385

[Forums] Find class or id name using Javascript

$
0
0

Hello,

I am trying to use javascript to get the current date and time and display it in an expression. I have placed the function in the webscreen javascript window and called it from the expression. When I place an alert, the date and time appear correctly. However, when I try to display it normally, it doesn't appear. This is my code

SyntaxEditor Code Snippet (From the webscreen javascript editor)

function getDateTime(inputId){    var d = new Date();    var element = document.getElementByClassName(inputId);    if(element != null){        element.value = d;    }else{        alert("Empty");    }
}

From the expression 

SyntaxEditor Code Snippet

"<script language='javascript'>    getDateTime("+DateTitle.Id+");</script>"

Please help


Viewing all articles
Browse latest Browse all 1476385

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>