# HTML tag input on ion-input

**URL:** <https://forum.ionicframework.com/t/html-tag-input-on-ion-input/94751>\
**Category:** ionic-v3\
**Created:** [June 17, 2017, 9:17am UTC](https://forum.ionicframework.com/t/html-tag-input-on-ion-input/94751 "2017-06-17T09:17:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Perreiz](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Perreiz](https://forum.ionicframework.com/u/Perreiz)\
**Post date:** [June 17, 2017, 9:17am UTC](https://forum.ionicframework.com/t/html-tag-input-on-ion-input/94751/1 "2017-06-17T09:17:53Z")

</div>

Hello,

I have to retrieve the html tag “input” of a ion-input for use the autocomplete of places provides by google.

I try to use the query selector on my ion-input elementRef but my result is always “null”, maybe i don’t have the right query selector tag ?

this is my code : for my .ts file

```auto
  @ViewChild('inputStart', { read: ElementRef }) inputStart: ElementRef;
  inputStartElem: HTMLInputElement = null;

  this.inputStartElem = this.inputStart.nativeElement.querySelector('input');

```

and my code for .html file :

```auto
        <ion-input id="inputStart" #inputStart ></ion-input>

```

So this.inputStartElem is always null.

If someone can help me on this 🙂

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![KishuPro](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@KishuPro](https://forum.ionicframework.com/u/KishuPro)\
**Post date:** [June 17, 2017, 11:03am UTC](https://forum.ionicframework.com/t/html-tag-input-on-ion-input/94751/2 "2017-06-17T11:03:39Z")

</div>

The `.ts` code you are writing is for your parent component, the `<ion-input>` is a child component of that inside its view. Now, depending on where you are trying to reference it in code, the child component might not be existing yet. So to make sure every child has been properly instantiated and initialised, you have to hook on to the parent component’s life-cycle event `ngAfterViewInit()` and initialise your ref variable there.

---

<div class="post-metadata">

**Author:** ![Perreiz](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Perreiz](https://forum.ionicframework.com/u/Perreiz)\
**Post date:** [June 17, 2017, 11:40am UTC](https://forum.ionicframework.com/t/html-tag-input-on-ion-input/94751/3 "2017-06-17T11:40:25Z")

</div>

Yes, i tried this solution but same result.

I’ve juste fixed this by use the « ionviewdidenter » method. My bug was that my ion-input wasn’t fully loaded.

Thanks a lot !
