-1

I am trying to get the value of ID but its showing null link https://codepen.io/rahulv/pen/zwjrXZ

function printCurrentTab(){
var content = "";
var activeTab = document.getElementById('activeDisTab').value;

getting error here in var activeTab

sam
  • 21
  • 4
  • 1
    You get an error because you use jquery `content += $('#' + activeTab).html();` but did not include it. `document.getElementById('activeDisTab')` on its own works just fine. – Christoph May 12 '17 at 15:19
  • Possible duplicate of [Uncaught ReferenceError: $ is not defined](http://stackoverflow.com/questions/12419724/uncaught-referenceerror-is-not-defined) – Christoph May 12 '17 at 15:21

1 Answers1

2

Juste replace jQuery part with plain JavaScript

Instead of this content += $('#' + activeTab).html();
Use this content += document.getElementById('activeDisTab').value;

Nebojsa Nebojsa
  • 1,395
  • 1
  • 7
  • 19