# Yugal JS Functions

## 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

```javascript
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>`;
```

{% hint style="info" %}
From Yugal 9.1, other extra functions from Yugal's built in module `yugal.js` in `modules/` directory are moved to external libray [here](https://github.com/sinhapaurush/yugalmods).
{% endhint %}
