even if i type $('.dropdown-menu li:selected').val(); i get the same result
@fez994 I don't know that <a> has a val() property, I think that is reserved for input elements
var g = $(this).attr("value"); this will get the attribute by name
@sjames1958gm I don't even know what is Babel, but I'll take a look.
@krckyboy I think the babel is only allowing ES6 in this pen. translating from ES6 to ES5
THe key is the data-content attribute, I believe
@sjames1958gm I'm looking at CSS attr(data-content), I guess that's the main part in CSS.
@krckyboy yeah I think so. it is saying that the content is coming from the data-content attribute of the element
I see how it could work, but now I need to figure out how to deal with :hover.. Basically, when I hover over an element, it needs to have the icon that would appear if I was to make the element "active" (the icon that toggles on and off each click).
@fez994 What do you mean use it outside the function? I guess you could make the variable "global". That would probably be considered bad form.
It means that var g only exsist inside of that function, if i want to use it outside of it i can't
@fez994 True, but if you called a function from within the click handler you could pass the value to it. What are you wanting to do with 'g'? Perhaps there is a different way
Hi all, Just got onto the build a calculator challenge, coded up the HTML and CSS quickly and now am onto the JS. I want to do this without jQuery, but not really got any idea of where to start. I'd rather not follow a guide but feeling a bit lost as to where to start. I've made a few variables to store inputs and hopefully will output them, but does anyone have a suggestion/resource that might assist without providing the answer?