The trouble is that, when i go to print the variable on the screen, the variable (title1) is ever undefined and not xxx like it must be. classname element js. Native JS has three ways to get the elements: getElementById(id) getElementsByName( name) getElementsByTagName(tag) getElementById Is the quickest way to get elements , But we cant give it to each HTML Elements are all to be ID bar , So we need a very You can alter the class association for an element by script. If the document includes an alternate class selector and style rule, adjusting the elements className property can provide a shortcut for adjusting many style properties at once. This probably isnt possible but does anyone know if/how you can get an element by its model name in vue.js .