this is my html
<div>
<h1 class="main-header logic-head av-settings-head"></h1>
<div class="col-xs-12 col-xs-12 col-lg-12 tabcontent" >
<form class="form-horizontal formtext col-xs-12 col-sm-10 col-lg-10 row">
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Name</label>
</div>
<div class="col-sm-5">
<input id="NewobjectName" type="text" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Description</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<textarea id="objectDescription" rows="3" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Type</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<select class="form-control">
<option>M</option>
<option>C</option>
<option>CM</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">IsActive</label>
</div>
<div class="col-sm-5">
<input type="checkbox" checked="true" />
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">
</label>
</div>
<div class="clearfix"></div>
<!-- Groups Area Tables Start -->
<div class="row">
<div role="tabpanel" class="tab_bg">
<!-- Nav tabs -->
<div tabset justified="true" ng-if="clientScript.specification=='commonSpecific'">
<div tab heading="ClientScript">
<div class="tab-content pad25 users-area">
<div role="tabpanel" class="tab-pane mart15 active" id="objectPermissions">
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Javascript Type</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<select class="form-control" ng-change="onEventChange(script.event)" ng-options="obj.eventName as obj.label for obj in events"
ng-model="script.event">
<option value="">-select event-</option>
</select>
</div>
</div>
<div class="method-tab" id="method-tab">
<div class="row form-group btnbg">
<div class=" col-xs-12 col-sm-6 col-lg-12">
<button class="btn btn-primary pull-right">ADD +</button>
<div class="clearfix"></div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-lg-12 well pad0">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs method-right">
<li class="active"><i></i><a target='_blank' href="#name" data-toggle="tab">Script 1</a></li>
<li class=""><i></i><a data-toggle="tab" target='_blank' href="#group-2">Script 2</a></li>
<li class=""><i></i><a target='_blank' href="#group-3" data-toggle="tab">Script 3</a></li>
<li class=""><i></i><a target='_blank' href="#group-4" data-toggle="tab">Script 4</a></li>
</ul>
<div class="tab-content content-left">
<div class="tab-pane col-xs-12 col-sm-8 col-lg-12 pad0 marl19 active" id="name">
<div class="col-lg-12">
<h4>Javascript Editor</h4>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-body min-height">
<div id="editor">
function foo(items) {
var i;
for (i = 0; i < items.length; i++) {
alert("Ace Rocks " + items[i]);
}
}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="row form-group btnbg">
<div class=" col-xs-12 col-sm-6 col-lg-12">
<button class="btn btn-primary pull-right">SAVE</button>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<button id="saveObject" class="btn btn-primary" ng-click="save()">
Validate
</button>
</div>
</div>
<div tab heading="SQL">
</div>
<div tab heading="HTML">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 col-lg-7 btnbg">
<button id="saveObject" class="btn btn-primary " ng-click="save()">
SAVE
</button>
</div>
</div>
</form>
</div>
and i am finding the element by id which is inside of tabset and that id name is "editor" but it is giving null
and my .js code is
var element=document.getElementById("editor");
the div with id "editor" is inside of tabset so i think that would be reason why it couldn't find it...so what would be the alternate method to handle this?
your code is working properly
var element = document.getElementById("editor");
snippet.log(element)
snippet.log(element.innerHTML)
<script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>
<div>
<h1 class="main-header logic-head av-settings-head"></h1>
<div class="col-xs-12 col-xs-12 col-lg-12 tabcontent">
<form class="form-horizontal formtext col-xs-12 col-sm-10 col-lg-10 row">
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Name</label>
</div>
<div class="col-sm-5">
<input id="NewobjectName" type="text" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Description</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<textarea id="objectDescription" rows="3" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Type</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<select class="form-control">
<option>M</option>
<option>C</option>
<option>CM</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">IsActive</label>
</div>
<div class="col-sm-5">
<input type="checkbox" checked="true" />
</div>
</div>
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">
</label>
</div>
<div class="clearfix"></div>
<!-- Groups Area Tables Start -->
<div class="row">
<div role="tabpanel" class="tab_bg">
<!-- Nav tabs -->
<div tabset justified="true" ng-if="clientScript.specification=='commonSpecific'">
<div tab heading="Scocu ClientScript">
<div class="tab-content pad25 users-area">
<div role="tabpanel" class="tab-pane mart15 active" id="objectPermissions">
<div class="form-group">
<div class="col-xs-12 col-sm-5 col-lg-3 paddnone">
<label class="control-label">Javascript Type</label>
</div>
<div class="col-xs-12 col-sm-5 col-lg-5 paddnone">
<select class="form-control" ng-change="onEventChange(script.event)" ng-options="obj.eventName as obj.label for obj in events" ng-model="script.event">
<option value="">-select event-</option>
</select>
</div>
</div>
<div class="method-tab" id="method-tab">
<div class="row form-group btnbg">
<div class=" col-xs-12 col-sm-6 col-lg-12">
<button class="btn btn-primary pull-right">ADD +</button>
<div class="clearfix"></div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-lg-12 well pad0">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs method-right">
<li class="active"><i></i><a target='_blank' href="#name" data-toggle="tab">Script 1</a>
</li>
<li class=""><i></i><a data-toggle="tab" target='_blank' href="#group-2">Script 2</a>
</li>
<li class=""><i></i><a target='_blank' href="#group-3" data-toggle="tab">Script 3</a>
</li>
<li class=""><i></i><a target='_blank' href="#group-4" data-toggle="tab">Script 4</a>
</li>
</ul>
<div class="tab-content content-left">
<div class="tab-pane col-xs-12 col-sm-8 col-lg-12 pad0 marl19 active" id="name">
<div class="col-lg-12">
<h4>Javascript Editor</h4>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-body min-height">
<div id="editor">
function foo(items) { var i; for (i = 0; i < items.length; i++) { alert("Ace Rocks " + items[i]); } }
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="row form-group btnbg">
<div class=" col-xs-12 col-sm-6 col-lg-12">
<button class="btn btn-primary pull-right">SAVE</button>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<button id="saveObject" class="btn btn-primary" ng-click="save()">
Validate
</button>
</div>
</div>
<div tab heading="Scocu SQL">
</div>
<div tab heading="Scocu HTML">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 col-lg-7 btnbg">
<button id="saveObject" class="btn btn-primary " ng-click="save()">
SAVE
</button>
</div>
</div>
</form>
</div>
I have created a sample typeorm project using the typeorm cli which has ormconfig.json by default: { "type": "postgres", "host": "localhost", "port": 5432, "username": "postgres", "...
I have created a sample typeorm project using the typeorm cli which has ormconfig.json by default: { "type": "postgres", "host": "localhost", "port": 5432, "username": "postgres", "...
I am using html2canvas.js to create a <canvas> image from a div on a page. What I'd like to do is send the rendered base64 image to a cfc via ajax so I can actually save the image to a folder on ...
I am using html2canvas.js to create a <canvas> image from a div on a page. What I'd like to do is send the rendered base64 image to a cfc via ajax so I can actually save the image to a folder on ...
I have the following setup where a custom checkmark is added to style the radio buttons. but it also adds that checkmark to the text type inputs. var changed =function(){ Array.from(...
I have the following setup where a custom checkmark is added to style the radio buttons. but it also adds that checkmark to the text type inputs. var changed =function(){ Array.from(...
I need to take some non-trivial javascript and ensure that all code paths have code that is valid. For example: var num = 1; if (num == 2) { badFunctionName(); } and I need to do this from C#. ...
I need to take some non-trivial javascript and ensure that all code paths have code that is valid. For example: var num = 1; if (num == 2) { badFunctionName(); } and I need to do this from C#. ...