Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<div class="input-col">
<h3><b>Search Result Content</b></h3>   
<!-- Title text -->

  <div class="entrytext">
  <label for="js-title-value">Type title text here</label>
<input id="js-title-value" type="text" value="">
  </div>

<!-- description/excerpt text -->
 <div class="entrytext">
<label for="js-excerpt-value">Type description/excerpt text here</label>
<input  class="textarea" id="js-excerpt-value" type="textarea" value="">
  </div>
<!-- question 1 text -->
<hr>
  <h3><b>FAQ Snippet</b></h3>
<div class="entrytext">

<div class="input-group">
<label for="js-QuestionOne-value">Question 1</label>
<input id="js-QuestionOne-value" type="text" value="">
<label for="js-QuestionOne-value">Answer 1</label>
  <textarea id="js-AnswerOne-value"  value=""></textarea>
</div>

<div class="input-group">
<label for="js-QuestionTwo-value">Question 2</label>
<input id="js-QuestionTwo-value" type="text" value="">
<label for="js-QuestionTwo-value">Answer 2</label>
<textarea id="js-AnswerTwo-value" class="textarea" value></textarea>
</div>
<div class="input-group">
<label for="js-QuestionThree-value">Question 3</label>
<input id="js-QuestionThree-value" type="text" value="">
<label for="js-QuestionThree-value">Answer 3</label>
  <textarea id="js-AnswerThree-value"  value=""></textarea>
 </div>
  </div>
    
  </div>


 <div class="output-col">
 <div class="bcrumb-container">
  <p class="breadcrumb">nesfinancial.com > 1031 Exchange</p><div class="tri"></div></div>
<a href="#">
<h3 id="js-title-block"></h3>
  </a>
  <p>Jul 6, 2020 - <span id="js-excerpt-block"></span>...</p>
<div class="accordion-container">
 

<button id="js-QuestionOne-block" class="accordion">What’s Unique About a Reverse 1031 Exchange?</button>
<div class="panel">
  <p id="js-AnswerOne-block"> </p>
</div>

<button id="js-QuestionTwo-block" class="accordion"></button>
<div class="panel">
  <p id="js-AnswerTwo-block"> </p>
</div>

<button id="js-QuestionThree-block" class="accordion"></button>
<div class="panel">
  <p class="answer" id="js-AnswerThree-block"> </p>
</div>
</div>
 <button class="accordion showmore" disabled >Show more</button>
   <div class="generator">


     <span class="tag"><<span>script type="application/ld+json"</span>></span>
<span><br>{<br>
<div class="indt">"@context": "https://schema.org",<br>
  <div class="indt">@type": "FAQPage",<br>
  "mainEntity": [{<br>
    "@type": "Question",<br>
    "name": "<span id="q-One-Gen">q1-question</span>",<br>
    "acceptedAnswer": {<br>
      "@type": "Answer",<br>
      "text": "<span id="a-One-Gen">q1-answer</span>"<br>
  }</div><br>
  },{<br>
   <div class="indt"> "@type": "Question",<br>
    "name": "<span id="q-Two-Gen">q2-question</span>",<br>
    "acceptedAnswer": {<br>
      "@type": "Answer",<br>
      "text": "<span id="a-Two-Gen">q2-answer</span>"<br>
     }</div><br>
  },{<br>
    <div class="indt">@type": "Question",<br>
    "name": "<span id="q-Three-Gen">q3-question</span>",<br>
    "acceptedAnswer": {<br>
      "@type": "Answer",<br>
      "text": "<span id="a-Three-Gen">q3-answer</span>"<br>
    }</div><br>
  }]<br></div>
}<br>
<span class="tag"><<span>/script</span>></span>


</div>
  </div> 
</div>





              
            
!

CSS

              
                body {
  font-family: 'Roboto', arial, sans-serif;
  width: 652px;
  font-weight:500;
  line-height: 1.3;
  color: #3C4043;
  margin:auto;
  width: 100%;

}

.container {
  width: 80%;
  max-width:800px;
  margin:auto;
}

.output-col, .input-col {
  width:48%;
  padding: 30px;
  display: inline-block;
}


/* Input column */

.input-col {
  float:left;
  width:40%;
  
  .entrytext {
    
    .input-group {
      display:flex;
      flex-direction:column;
      background-color: #f7f7f7;
      padding:10px;
      margin: 10px 0;
    }
    
    display:flex;
    flex-direction:column;
    margin-bottom:20px;
    
    label {
      font-size: 16px;
    }
    
    input {
      margin: 5px 0px;
      height: 32px;
      
    }
    textarea {
      height: 100px;
      font-family: 'Roboto', arial;
      font-size: .8em;
      padding: 10px 3px;
    }
    
  }

}

.output-col {
  float: right;
overflow:hidden;  

  max-width: 400px;
  position:fixed;
  top:0;
 
  
p {
  font-size: 14px;
  line-height: 1.58;
  padding:0px;
  margin:0px;
  width: auto;
}

  
/* SERP Breadcrumb */
.breadcrumb {
  font-size: 14px;
  font-color: #3C4043;
  margin-bottom: 0px;
  padding-right:8px;
}
  
.bcrumb-container{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  
}
  
/* arrow beside breadcrumb */
.tri {
width: 0;
height: 0;
border-style: solid;
border-width: 5px 4px 0 4px;
border-color: #000000 transparent transparent transparent;
}

 /* SERP Title */
h3 {
  font-size: 20px;
  margin-top: 4px;
  margin-bottom:4px;
}

a {
  text-decoration: none;
}

a:hover {
    text-decoration: underline;
  }

/* FAQ Accordion */
.accordion-container {
  border: none;
  border-radius: 8px;
  padding:10px 0px 0px 0px;
  width: 100%;
}

.accordion-title {
  padding: 9px 16px;
  font-size: 20px;
  color: #222;
}

.accordion {
  background-color: #ffffff;
  color: #444;
  cursor: pointer;
  padding: 9px 0px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 14px;
  transition: 0.4s;
  border-top: 1px solid #ebebeb;
  transition: 0.4s;

}


.active, .accordion:hover {
  background-color: #fff; 
}

.accordion:after {
	content: "\f107";
  color: #777;
  font-size: 15px;
  font-weight: bold;
  float: right;
  margin-left: 5px;
  font-family: "FontAwesome";

}
  
.showmore {
}
.accordion.showmore:after {
  float:left;
  padding-right: 10px;
  padding-left:5px;
  margin:0px;
  display:flex;
  align-items:center;
  
}

.active:after {
	content: "\f106";
}

 /* Accordion panel contents */
.panel {
  padding: 0px;
  margin:0px;
  display: none;
  background-color: white;
  overflow: hidden;
  transition: max-height 0.2s ease-out;

}

.panel p {
    background-color: #f8f8f8;
  padding: 12px 16px 16px 16px;
    
}
  
}

//generator
.generator {
  height: 200px;
  overflow:scroll;
  background:#2b2b2b;
  color: #ffffff;
  font-family: courier;
  font-size: .8em;
  padding: 10px;
}


.indt {
  margin-left:1em;
}
              
            
!

JS

              
                
var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
  acc[i].addEventListener("click", function() {
    this.classList.toggle("active");
    var panel = this.nextElementSibling;
    if (panel.style.display === "block") {
      panel.style.display = "none";
    } else {
      panel.style.display = "block";
    }
  });
}


// realtime typing - Title
(() => {
  const jsTextBlock = document.getElementById('js-title-block'),
  jsTextInput = document.getElementById('js-title-value');

  if (jsTextInput.value.length === 0) {
    jsTextBlock.innerHTML = 'This is a nice title';
  }

  jsTextInput.addEventListener('input', () => {
    jsTextBlock.setAttribute('data-text', jsTextInput.value);

    jsTextBlock.innerHTML = jsTextBlock.getAttribute('data-text');

    if (jsTextInput.value.length === 0) {
      jsTextBlock.innerHTML = 'Empty';
    }
  });

})();

// realtime typing - Excerpt
(() => {
  const jsExcerptBlock = document.getElementById('js-excerpt-block'),
  jsExcerptInput = document.getElementById('js-excerpt-value');

  if (jsExcerptInput.value.length === 0) {
    jsExcerptBlock.innerHTML = 'This is a nice description';
  }

  jsExcerptInput.addEventListener('input', () => {
    jsExcerptBlock.setAttribute('data-text', jsExcerptInput.value);

    jsExcerptBlock.innerHTML = jsExcerptBlock.getAttribute('data-text');

    if (jsExcerptInput.value.length === 0) {
      jsExcerptBlock.innerHTML = 'This is a nice description';
    }
  });

})();

// realtime typing - QuestionOne
(() => {
  const jsQuestionOneBlock = document.getElementById('js-QuestionOne-block'),
  jsQuestionOneInput = document.getElementById('js-QuestionOne-value');

  if (jsQuestionOneInput.value.length === 0) {
    jsQuestionOneBlock.innerHTML = 'Question one text?';
  }

  jsQuestionOneInput.addEventListener('input', () => {
    jsQuestionOneBlock.setAttribute('data-text', jsQuestionOneInput.value);

    jsQuestionOneBlock.innerHTML = jsQuestionOneBlock.getAttribute('data-text');

    if (jsQuestionOneInput.value.length === 0) {
      jsQuestionOneBlock.innerHTML = 'Question one text?';
    }
  });

})();


// realtime typing - Q1 Generator
(() => {
 
  const jsQuestionOneInput = document.getElementById('js-QuestionOne-value');
  const jsQOneGenBlock = document.getElementById('q-One-Gen');

  if (jsQuestionOneInput.value.length === 0) {
    jsQOneGenBlock.innerHTML = 'Question-one-text';
  }

  jsQuestionOneInput.addEventListener('input', () => {
    jsQOneGenBlock.setAttribute('data-text', jsQuestionOneInput.value);

    jsQOneGenBlock.innerHTML = jsQOneGenBlock.getAttribute('data-text');


    if (jsQuestionOneInput.value.length === 0) {
      jsQOneGenBlock.innerHTML = 'Question-one-text';
      
    }
  });

})();


// realtime typing - AnswerOne
(() => {
  const jsAnswerOneBlock = document.getElementById('js-AnswerOne-block'),
  jsAnswerOneInput = document.getElementById('js-AnswerOne-value');

  if (jsAnswerOneInput.value.length === 0) {
    jsAnswerOneBlock.innerHTML = 'Answer one text?';
  }

  jsAnswerOneInput.addEventListener('input', () => {
    jsAnswerOneBlock.setAttribute('data-text', jsAnswerOneInput.value);

    jsAnswerOneBlock.innerHTML = jsAnswerOneBlock.getAttribute('data-text');

    if (jsAnswerOneInput.value.length === 0) {
      jsAnswerOneBlock.innerHTML = 'Answer one text?';
    }
  });

})();



// realtime typing - A1 Generator
(() => {
 
  const jsAnswerOneInput = document.getElementById('js-AnswerOne-value');
  const jsAOneGenBlock = document.getElementById('a-One-Gen');

  if (jsAnswerOneInput.value.length === 0) {
    jsAOneGenBlock.innerHTML = 'Answer-one-text';
  }

  jsAnswerOneInput.addEventListener('input', () => {
    jsAOneGenBlock.setAttribute('data-text', jsAnswerOneInput.value);

    jsAOneGenBlock.innerHTML = jsAOneGenBlock.getAttribute('data-text');


    if (jsAnswerOneInput.value.length === 0) {
      jsAOneGenBlock.innerHTML = 'Answer-one-text';
      
    }
  });

})();




// realtime typing - QuestionTwo
(() => {
  const jsQuestionTwoBlock = document.getElementById('js-QuestionTwo-block'),
  jsQuestionTwoInput = document.getElementById('js-QuestionTwo-value');

  if (jsQuestionTwoInput.value.length === 0) {
    jsQuestionTwoBlock.innerHTML = 'Question two text?';
  }

  jsQuestionTwoInput.addEventListener('input', () => {
    jsQuestionTwoBlock.setAttribute('data-text', jsQuestionTwoInput.value);

    jsQuestionTwoBlock.innerHTML = jsQuestionTwoBlock.getAttribute('data-text');

    if (jsQuestionTwoInput.value.length === 0) {
      jsQuestionTwoBlock.innerHTML = 'Question two text?';
    }
  });

})();



// realtime typing - Q2 Generator
(() => {
 
  const jsQuestionTwoInput = document.getElementById('js-QuestionTwo-value');
  const jsQTwoGenBlock = document.getElementById('q-Two-Gen');

  if (jsQuestionTwoInput.value.length === 0) {
    jsQTwoGenBlock.innerHTML = 'Question-two-text';
  }

  jsQuestionTwoInput.addEventListener('input', () => {
    jsQTwoGenBlock.setAttribute('data-text', jsQuestionTwoInput.value);

    jsQTwoGenBlock.innerHTML = jsQTwoGenBlock.getAttribute('data-text');


    if (jsQuestionTwoInput.value.length === 0) {
      jsQTwoGenBlock.innerHTML = 'Question-two-text';
      
    }
  });

})();




// realtime typing - AnswerTwo
(() => {
  const jsAnswerTwoBlock = document.getElementById('js-AnswerTwo-block'),
  jsAnswerTwoInput = document.getElementById('js-AnswerTwo-value');

  if (jsAnswerTwoInput.value.length === 0) {
    jsAnswerTwoBlock.innerHTML = 'Answer two text?';
  }

  jsAnswerTwoInput.addEventListener('input', () => {
    jsAnswerTwoBlock.setAttribute('data-text', jsAnswerTwoInput.value);

    jsAnswerTwoBlock.innerHTML = jsAnswerTwoBlock.getAttribute('data-text');

    if (jsAnswerTwoInput.value.length === 0) {
      jsAnswerTwoBlock.innerHTML = 'Answer two text?';
    }
  });

})();



// realtime typing - A2 Generator
(() => {
 
  const jsAnswerTwoInput = document.getElementById('js-AnswerTwo-value');
  const jsATwoGenBlock = document.getElementById('a-Two-Gen');

  if (jsAnswerTwoInput.value.length === 0) {
    jsATwoGenBlock.innerHTML = 'Answer-two-text';
  }

  jsAnswerTwoInput.addEventListener('input', () => {
    jsATwoGenBlock.setAttribute('data-text', jsAnswerTwoInput.value);

    jsATwoGenBlock.innerHTML = jsATwoGenBlock.getAttribute('data-text');


    if (jsAnswerTwoInput.value.length === 0) {
      jsATwoGenBlock.innerHTML = 'Answer-two-text';
      
    }
  });

})();




// realtime typing - QuestionThree
(() => {
  const jsQuestionThreeBlock = document.getElementById('js-QuestionThree-block'),
  jsQuestionThreeInput = document.getElementById('js-QuestionThree-value');

  if (jsQuestionThreeInput.value.length === 0) {
    jsQuestionThreeBlock.innerHTML = 'Question Three text?';
  }

  jsQuestionThreeInput.addEventListener('input', () => {
    jsQuestionThreeBlock.setAttribute('data-text', jsQuestionThreeInput.value);

    jsQuestionThreeBlock.innerHTML = jsQuestionThreeBlock.getAttribute('data-text');

    if (jsQuestionThreeInput.value.length === 0) {
      jsQuestionThreeBlock.innerHTML = 'Question Three text?';
    }
  });

})();


// realtime typing - Q3 Generator
(() => {
 
  const jsQuestionThreeInput = document.getElementById('js-QuestionThree-value');
  const jsQThreeGenBlock = document.getElementById('q-Three-Gen');

  if (jsQuestionThreeInput.value.length === 0) {
    jsQThreeGenBlock.innerHTML = 'Question-three-text';
  }

  jsQuestionThreeInput.addEventListener('input', () => {
    jsQThreeGenBlock.setAttribute('data-text', jsQuestionThreeInput.value);

    jsQThreeGenBlock.innerHTML = jsQThreeGenBlock.getAttribute('data-text');


    if (jsQuestionThreeInput.value.length === 0) {
      jsQThreeGenBlock.innerHTML = 'Question-three-text';
      
    }
  });

})();



// realtime typing - AnswerThree
(() => {
  const jsAnswerThreeBlock = document.getElementById('js-AnswerThree-block'),
  jsAnswerThreeInput = document.getElementById('js-AnswerThree-value');

  if (jsAnswerThreeInput.value.length === 0) {
    jsAnswerThreeBlock.innerHTML = 'Answer Three text?';
  }

  jsAnswerThreeInput.addEventListener('input', () => {
    jsAnswerThreeBlock.setAttribute('data-text', jsAnswerThreeInput.value);

    jsAnswerThreeBlock.innerHTML = jsAnswerThreeBlock.getAttribute('data-text');

    if (jsAnswerThreeInput.value.length === 0) {
      jsAnswerThreeBlock.innerHTML = 'Answer Three text?';
    }
  });

})();

// realtime typing - A3 Generator
(() => {
 
  const jsAnswerThreeInput = document.getElementById('js-AnswerThree-value');
  const jsAThreeGenBlock = document.getElementById('a-Three-Gen');

  if (jsAnswerThreeInput.value.length === 0) {
    jsAThreeGenBlock.innerHTML = 'Answer-three-text';
  }

  jsAnswerThreeInput.addEventListener('input', () => {
    jsAThreeGenBlock.setAttribute('data-text', jsAnswerThreeInput.value);

    jsAThreeGenBlock.innerHTML = jsAThreeGenBlock.getAttribute('data-text');


    if (jsAnswerThreeInput.value.length === 0) {
      jsAThreeGenBlock.innerHTML = 'Answer-three-text';
      
    }
  });

})();


              
            
!
999px

Console