Add link to a button in EJ2 TypeScript Button control

10 May 20232 minutes to read

The appearance of the Button can be changed like a link by e-link class using cssClass property and link navigation can be handled in Button click.

In the following example, link is added in Button click by using method.

import { Button } from '@syncfusion/ej2-buttons';
import { enableRipple} from '@syncfusion/ej2-base';


// Initialize the Button component.
let button: Button = new Button({cssClass: 'e-link'});

// Render initialized button.

button.element.onclick = (): void => {"");
<!DOCTYPE html>
<html lang="en">

    <title>EJ2 Button</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="" rel="stylesheet" />
    <link href="" rel="stylesheet" />
    <link href="styles.css" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>
<script src="" type ="text/javascript"></script>

    <div id='loader'>LOADING....</div>
    <div id='container'>
        <button id='element'>Go to Google</button>

#container {
    visibility: hidden;

#loader {
  color: #008cff;
  height: 40px;
  left: 45%;
  position: absolute;
  top: 45%;
  width: 30%;