function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

popup message which renders through the repeat

I have the below button on vf page.

<div id="previewButton" onclick="ShowPopup()">

Javascript on the vf page


var modal = document.getElementById('previewModal');
var btn = document.getElementById("previewButton");
var span = document.getElementsByClassName("previewclose")[0];

<!--Script for Preview Popup-->
function ShowPopup()

{ = "block";

span.onclick = function() { = "none";

window.onclick = function(event) {
    if ( == modal) { = "none";

Modal Pop up on the vf page

<div id="previewModal" class="preview">  
  <div class="previewbody ">
    <div class="previewtitleholder">
      <div class="previewtitle">
         <span class="previewclose"> &times;</span>
  <div class="cockpitpreviewtext"> 


whne I click on the popup it should go throughthe the meesage preview field of each item record and display that message in the popup.But with this code no message is just blank.