{"absolute_url": "https://alexjosesilva.snipt.net/ocultar-div-apartir-da-tag-select-ebf7415f/", "blog_post": true, "code": "\n\n\n\n\n\n \n \n\t\t\n \n \n \n
\n\t\t\t
\n\t\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n \n
\n\n", "created": "2014-07-09T11:42:57.502083", "description": "Ocultar div apartir de um select usando jqueryu", "description_rendered": "Ocultar div apartir de um select usando jqueryu", "embed_url": "https://snipt.net/embed/4362d6bb0fec00eba40ec9006507db93/", "full_absolute_url": "https://alexjosesilva.snipt.net/ocultar-div-apartir-da-tag-select-ebf7415f/", "id": 135727, "lexer": "html", "line_count": 41, "log_entries": [], "meta": null, "modified": "2017-01-01T02:33:36.914340", "publish_date": "2014-07-09T11:42:57.485978", "raw_url": "/raw/4362d6bb0fec00eba40ec9006507db93/", "resource_uri": "/api/public/snipt/135727/", "slug": "ocultar-div-apartir-da-tag-select-ebf7415f", "stylized": "
 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41
<html>\n<head>\n<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>\n<script type="text/javascript">\n$(document).ready(function(){\n        $("#palco > div").hide();\n        $("#sel-sexo").change(function(){\n                $("#palco > div").hide();\n                $( '#'+$( this ).val() ).show('fast');\n        });\n        $("input[name='rd-sexo']").click(function(){\n                $("#palco > div").hide();\n                $( '#'+$( this ).val() ).show('fast');  \n        });\n});\n</script>\n</head>\n<body>\n       \n        <select name="sel-sexo" id="sel-sexo">\n\t\t\t<option value="0">Selecione</option>\n\t\t\t<option value="1">Titular</option>\n\t\t\t<option value="2">Dependente</option>\n        </select>\n\t\t\n        <label><input type="radio" name="rd-sexo" value="1" />Titular</label>\n        <label><input type="radio" name="rd-sexo" value="2" />Dependente</label>\n       \n        <div id="palco">\n\t\t\t<div id="1">\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id="2">\n\t\t\t\t<label>Informe a matricula do Titular</label><br>\n\t\t\t\t\t<input type="text" name="input-sexo" title="matricula titular" />\n\t\t\t\t</label>\n\t\t\t</div>\n                \n        </div>\n</body>\n</html>\n
\n
", "tags": [{"absolute_url": "/public/tag/jquery/", "id": 17, "name": "jquery", "resource_uri": "/api/public/tag/17/", "snipts": "/api/public/snipt/?tag=17"}, {"absolute_url": "/public/tag/html/", "id": 67, "name": "html", "resource_uri": "/api/public/tag/67/", "snipts": "/api/public/snipt/?tag=67"}], "title": "Ocultar Div apartir da tag SELECT", "user": {"absolute_url": "/alexjosesilva/", "email_md5": "aeee1adb46d99d6d54bb7b0d325a259f", "id": 18522, "resource_uri": "/api/public/user/18522/", "snipts": "/api/public/snipt/?user=18522", "snipts_count": 6, "username": "alexjosesilva"}}