JAVASCRIPT NOT WORKING! Script tags dont work in grafana html panel

I am using ver 6.1 of grafana. I have added an html panel to the dashboard and added the following html code with a script. console.log works like it is supposed to but getelementbyID value always shows a null string even if I have something selected. Am I doing something wrong here. I have followed the following documentations as well.

You enable it on grafana.ini and restart the grafana-server?

@mrobles Yes I have enabled it in grafana.ini and restarted the server. Still it doesnt work :confused: