I have a javascript:
var menuname = $(this).attr('id');
alert(menuname);
This gets the id of this anchor:
<a class=\"menuname\" id=" .$value['menuname']. " href='#' value=" .$value['menuname']. ">".$value['menuname']."</a>
My question is:
How to make the id accept two words.
For example: I want the id to be Hello World
in this case, it only accepts the id to be Hello
so I cant reference it properly.
I tried to search for ideas on this but all I found is how to just get the first word of the two words phrase it is not what I want any suggestions is appreciated.
Update:
Using attribute id is not an option now making use of attr value still same result i still get the first letter only which i need it to be the two letter value of attr value any idea is appreciated