I've got a Bootstrap button group that has 2 buttons (JSON and XML) with JSON being active when the page is loaded. Pressing the XML button will automatically change focus to it.
Now, I'd like to attach some behavior to these buttons so that clicking the XML button hides the error-json
pre element and shows the error-xml
pre element.
Is there a Bootstrap-native way to accomplish this?
<div class="btn-group">
<button class="btn btn-default" autofocus="true">JSON</button>
<button class="btn btn-default">XML</button>
</div>
<pre id="error-json" class="hidden"><code class="language-json">{
"ErrorCode": STATUS_CODE,
"Description": ERROR_MSG
}</code></pre>
<pre id="error-xml"><code class="language-xml"><error>
<ErrorCode>STATUS_CODE</ErrorCode>
<Description>ERROR_MSG</Description>
</error>
</code></pre>