# How i use html tags in ts file ionic 4

**URL:** <https://forum.ionicframework.com/t/how-i-use-html-tags-in-ts-file-ionic-4/164646>\
**Category:** Ionic Framework\
**Created:** [May 24, 2019, 7:07am UTC](https://forum.ionicframework.com/t/how-i-use-html-tags-in-ts-file-ionic-4/164646 "2019-05-24T07:07:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pksquare](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@pksquare](https://forum.ionicframework.com/u/pksquare)\
**Post date:** [May 24, 2019, 7:07am UTC](https://forum.ionicframework.com/t/how-i-use-html-tags-in-ts-file-ionic-4/164646/1 "2019-05-24T07:07:48Z")

</div>

i have to use html tag in a variable like  
let test=“

# Hello

## Mr
”

```auto
let test="<html><h1>Hello</h1><h2>Mr</h2></html>"

```

How i used this. please suggest me any soltion

---

<div class="post-metadata">

**Author:** ![ramon](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ramon/32/75852_2.png) [@ramon](https://forum.ionicframework.com/u/ramon)\
**Post date:** [May 24, 2019, 11:48am UTC](https://forum.ionicframework.com/t/how-i-use-html-tags-in-ts-file-ionic-4/164646/2 "2019-05-24T11:48:38Z")

</div>

Your question is not clear at all.  
However, I believe that what you are looking for is this:

```auto
let test = "<h1>Hello<h1><h2>Mr<h2>";

```

```auto
<div [innerHtml]="test"></div>

```
