Yugal JS Functions
These functions are only valid for JavaScript part of the app.
yugal.title(title)
Sets/Updates the title of the page. Accepts one string as parameter. Returns current page title if nothing passed.
yugal.header(head_html);
Injects page specific <head>
code to DOM. Code injected by this function is removed when page is navigated.
yugal.$(element_key);
Similar to jQuery, this element return respective element. It accepts only one parameter in string
You can provide class name/id/tag name in it just like CSS rule.
Example
const {$} = yugal;
console.log($("#mydiv")); //RETURN element with mydiv id
console.log($(".someclass")); //RETURNS element with 'someclass' class name
console.log($("div")); //Returns div tag
//Usage
$("#mydiv").innerHTML = `<h1>Hello World</h1>`;
Last updated