当前位置:网站首页>Why is it invalid to assign values to offsetwidth and offsetHeight
Why is it invalid to assign values to offsetwidth and offsetHeight
2022-06-23 20:56:00 【It workers】
This chapter introduces a problem that is easy to occur among beginners , to offsetWidth and offsetHeight Invalid assignment .
Invalid assignment is a correct phenomenon , Because it is a read-only attribute .
The code example is as follows :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Front end tribe </title>
<style type="text/css">
#antzone{
width:200px;
height:100px;
background:#ccc;
}
</style>
<script>
window.onload = function () {
var antzone = document.getElementById("antzone");
antzone.offsetHeight = 200;
}
</script>
</head>
<body>
<div id="antzone"></div>
</body>
</html>because offsetWidth and offsetHeight Is a read-only property , So the assignment failed .
边栏推荐
- How to use data warehouse to create time series
- Importance and purpose of test
- How does the fortress machine connect to the server? Novice must know operation steps
- 券商选哪个比较好尼?本人小白不懂,在线开户安全么?
- Is Guoyuan futures trading software formal? How to download safely?
- Strokeit- the joy of one handed fishing you can't imagine
- 【白话技术】二维码
- . NET Framework . Net core and Net standard
- How to process the text of a picture into a table? Can the text in the picture be transferred to the document?
- Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
猜你喜欢
Implementing MySQL fuzzy search with node and express

Daily question brushing record (II)

重庆 奉节耀奎塔,建成后当地连中五名进士,是川江航运的安全塔

Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181

Tcp/udp Fundamentals

Syntaxe des requêtes fédérées SQL (inline, left, right, full)

Yaokui tower in Fengjie, Chongqing, after its completion, will be the safety tower for Sichuan river shipping with five local scholars in the company

Eight misunderstandings, broken one by one (final): the cloud is difficult to expand, the customization is poor, and the administrator will lose control?

SQL聯合查詢(內聯、左聯、右聯、全聯)的語法

JS advanced programming version 4: generator learning
随机推荐
[golang] type conversion summary
How to build a personal cloud game server? How many games can the cloud game platform install?
What is the role of computer auto audit audio? What content failed to pass the audit?
Configure two databases in master-slave database mode (master and slave)
Development and code analysis of easycvr national standard user defined streaming address function
How PostgreSQL quickly locate blocking SQL
100 lines of code, using pyGame to make a snake game!
How to build a cloud game platform? Disadvantages of traditional games
Disaster recovery series (VII) -- hybrid cloud public network export disaster recovery construction
What are the server host security risks? How to prevent safety risks?
JS delete object attribute
实现vscode写markdown文档+图片自动上传至腾讯云cos
Use of the vs2022scanf function. An error is reported when using scanf - the return value is ignored: Solutions
3000 frame animation illustrating why MySQL needs binlog, redo log and undo log
[golang] delving into strings -- from byte run string to unicode and UTF-8
How to use data warehouse to create time series
December 29, 2021: the elimination rules of a subsequence are as follows: 1. In a subsequence
WinDbg loads mex DLL analysis DMP file
How to open a domestic futures account? Which futures company is safer to open an account?
How to handle the prompt that DNS is incorrect when adding resolution to Tencent cloud?