我有一个<textarea>评论。当我调整浏览器窗口大小时,评论框没有调整大小,因此在小屏幕上,评论框太大并溢出页面。我怎样才能防止这种情况发生?
我假设我需要@media screen在调整浏览器大小时添加一个查询,但我不确定我会在哪里添加它。
function commentSubmit() {
if (form1.name.value == '' && form1.comments.value == '') { //exit if one of the field is blank
alert('Enter your message !');
return;
}
$('#imageload').show();
var name = form1.name.value;
var comments = form1.comments.value;
var xmlhttp = new XMLHttpRequest(); //http request instance
xmlhttp.onreadystatechange = function() { //display the content of insert.php once successfully loaded
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('comment_logs').innerHTML = xmlhttp.responseText; //the chatlogs from the db will …Run Code Online (Sandbox Code Playgroud)