Question: I want to create a variable called Geo who'll show me the user location using the area code of a phone field in my form.
The area code HTML attached below.

I created this:

function flag(){
 var getTitle = document.getElementsByClassName("selected-flag").getAttribute("title");  

}

but it's not working.

Any suggestions?
[The form's area code HTML](https://i.stack.imgur.com/896c3.jpg)

Answer: 
It probably comes from your `angular-cli` installation/version. Try to uninstall/re-install it :

Re-install generally 

```
npm uninstall -g @angular/cli
npm install -g @angular/cli

```

Re-install for a local project :

```
npm uninstall --save @angular/cli
npm install --save @angular/cli

```
Delete the node\_modules folder and go to the path (myFolder) where you want to generate a new component and run the below command

```
ng g component my-new-component

```