Показанный ниже JavaScript включен в процесс while. Я надеюсь, что смогу использовать умножение var и в JavaScript. Но, похоже, это не работает.
Вот событие onclick моей базы JavaScript:
Код: Выделить всё
[img]comment.png[/img]
// Get the modal
var modal = document.getElementById('myModal');
// Get the button that opens the modal
var btn = document.getElementById("comment");
// Get the element that closes the modal
var span = document.getElementsByClassName("close")[0];
//var idpost = document.getElementById("comment").alt;
var textarea = 'hai';
var a = "textarea";
var b = "";
var c = a+b;
document.getElementById(c).value=textarea;
// When the user clicks the button, open the modal
function myFunction() {
modal.style.display = "block";
}
// When the user clicks on (x), close the modal
span.onclick = function() {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/39469875/javascript-html-and-php-pop-up-window[/url]
Мобильная версия