Meiczyslaw / bwa-u3-jammming-prj

0 stars 0 forks source link

Link tags should only be used for links, not as a button to search #3

Open alexander-dubinski opened 5 years ago

alexander-dubinski commented 5 years ago

https://github.com/Meiczyslaw/bwa-u3-jammming-prj/blob/31f6bd19de27ba550e0cd9496e241f4d7c079d49/src/components/SearchBar/SearchBar.js#L27

In this case, a <button></button> tag should be used, As a best practice, <a> tags should only be used for links. Furthermore, if you wrap the input and button in a <form> tag and set an attribute on the button type="submit", search will be initiated when the user presses enter.

Meiczyslaw commented 5 years ago

Duly noted. However, the HTML that was dictated in the project included the a-tag. https://s3.amazonaws.com/codecademy-content/programs/react/jammming/components-html-css/searchbar/searchbarhtml.txt Furthermore, the provided CSS supports the a-tag, but not a button. https://s3.amazonaws.com/codecademy-content/programs/react/jammming/components-html-css/searchbar/searchbarCss.txt