{"action":"created","issue":{"url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/84","labels_url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/84/comments","events_url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/84/events","html_url":"https://github.com/ebeshero/DHClass-Hub/issues/84","id":117950539,"number":84,"title":"Hide/Show in Javascript","user":{"login":"blawrence719","id":14064682,"avatar_url":"https://avatars.githubusercontent.com/u/14064682?v=3","gravatar_id":"","url":"https://api.github.com/users/blawrence719","html_url":"https://github.com/blawrence719","followers_url":"https://api.github.com/users/blawrence719/followers","following_url":"https://api.github.com/users/blawrence719/following{/other_user}","gists_url":"https://api.github.com/users/blawrence719/gists{/gist_id}","starred_url":"https://api.github.com/users/blawrence719/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blawrence719/subscriptions","organizations_url":"https://api.github.com/users/blawrence719/orgs","repos_url":"https://api.github.com/users/blawrence719/repos","events_url":"https://api.github.com/users/blawrence719/events{/privacy}","received_events_url":"https://api.github.com/users/blawrence719/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-20T02:06:12Z","updated_at":"2015-11-20T02:43:56Z","closed_at":null,"body":"I'm having an issue getting my button to work to hide/show an element. I am attempting to work off my Dickinson homepage example and have a button above the table and I'm trying to make the button so that when you click it, the table with disappear/appear. I have two things attempted in my Javascript and am unsure how to make the button work. Here is what I have:\r\n\r\n`var buttons = document.getElementsByTagName(\"button\");\r\nvar button = buttons[0];\r\nbutton.onclick = show_hide;\r\nif (table.style.display=\"none\"){\r\n    $(\"table\").show(1000)\r\n}\r\nelse {\r\n    $(\"table\").hide(1000)}`\r\n\r\nThat I got from reading on obdurodon and then this next attempt was from w3schools:\r\n\r\n`    $(document).ready(function(){\r\n    $(\"button\").click(function(){\r\n        $(\"table\").hide(1000);\r\n    });\r\n});`\r\n"},"comment":{"url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/comments/158263028","html_url":"https://github.com/ebeshero/DHClass-Hub/issues/84#issuecomment-158263028","issue_url":"https://api.github.com/repos/ebeshero/DHClass-Hub/issues/84","id":158263028,"user":{"login":"amielnicki","id":1958590,"avatar_url":"https://avatars.githubusercontent.com/u/1958590?v=3","gravatar_id":"","url":"https://api.github.com/users/amielnicki","html_url":"https://github.com/amielnicki","followers_url":"https://api.github.com/users/amielnicki/followers","following_url":"https://api.github.com/users/amielnicki/following{/other_user}","gists_url":"https://api.github.com/users/amielnicki/gists{/gist_id}","starred_url":"https://api.github.com/users/amielnicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amielnicki/subscriptions","organizations_url":"https://api.github.com/users/amielnicki/orgs","repos_url":"https://api.github.com/users/amielnicki/repos","events_url":"https://api.github.com/users/amielnicki/events{/privacy}","received_events_url":"https://api.github.com/users/amielnicki/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T02:43:56Z","updated_at":"2015-11-20T02:43:56Z","body":"So first you define a function called buttons to house the two \"var\" lines and the \"onClick\" line, and then a separate one to house the if/else statements. Like such:\r\n\r\n`function buttons() {`\r\n`<!--Put var button lines and \"onClick\" line in here-->`\r\n`}`\r\n`function show_hide() {`\r\n`<!--Put if/else statement in here-->`\r\n`}`"}}