Use Case: Here, we will create a Javascript function which will accept a name string as input and return concatenated greetings.
Javascript code:
PageModule.prototype.greetingsFunction = function(name) {
var result = "Hello " + name + ". Have a nice day !!";
};
High level Steps:
- Create a javascript function code.
- Take an input text (name) and a text area(greetings) and create 2 variables varName and varGreetings and map them to the name and greetings element.
- From name element >> create an event and call the javascript using call function and feed input with varNane and take the result and map back to grestings variable.
Steps with Screenshots:
Create a new web application
No comments:
Post a Comment