Javascript.RU

DOM: работа с HTML-страницей

Update: Более новый материал по этой теме находится по адресу https://learn.javascript.ru/document.

Большинство действий в javascript выполняется с HTML-страницей. В javascript страница представлена в виде объектной модели DOM (Document Object Model).

Любые действия со страницей требуют вызова соответствующего метода DOM.

Понимание, как работать с документом в модели DOM - краеугольный камень в javascript-программировании.


Автор: Hagrael, дата: 7 июля, 2010 - 14:22
#permalink

Спасибо! Надо читать, и вам понравится! Написано очень живо, без лишнего занудства! Коротко и ясно! И красочно! По вопросам обращайтесь на форуме, вам там помогут, как помогли мне!


Автор: PolarBear, дата: 25 января, 2011 - 13:44
#permalink

следующий код должен строить сетку при нажатии на кнопку, но вместо этого
каждый раз появляется только один квадрат

подскажите где ошибка

<style>
      .draw-field{
  border: 1px dashed black;
  width: 100px;
  height: 100px;
}

.cell{
  background-color: #ffffff;
  border: 1px solid black;
  width: 15px;
  height: 15px;
  display: inline-block;
  


}
    </style>
<script type="text/javascript">
     function CreateGrid(){
      var DrawField = document.getElementById('draw-field');
      var NewCell = document.createElement("div");
      var CellX = document.getElementById('height').value;
      var CellY = document.getElementById('width').value;
      NewCell.setAttribute('class','cell');
      CellX = parseInt(CellX);
      CellY = parseInt(CellY);
      for (var x=1; x<=CellX; x++)
        for (var y=1; y<=CellY; y++){
          DrawField.appendChild(NewCell);
        }
      }
    </script>
<input id="width" size="5" value="3">x<input id="height" size="5" value="3">
    <input type="button" onclick="CreateGrid()" value="GO"><br /><br />
    <div class="draw-field" id="draw-field"></div>

Автор: Гость (не зарегистрирован), дата: 31 марта, 2011 - 17:47
#permalink

Очевидно же. У вас при создание новое ячейки никак независит от x и y. Вам нужно при создании ячейки , сделать зависимость от x и y.


Автор: niku (не зарегистрирован), дата: 14 июля, 2020 - 11:22
#permalink

It is wonderful to be here with everyone, I have a lot of knowledge from what you share, to say thank you, the information and knowledge here helps me a lot temple run


Автор: zhurchik, дата: 2 марта, 2013 - 16:10
#permalink

Спасибо, все четенько и понятно!


Автор: Гость (не зарегистрирован), дата: 24 марта, 2014 - 17:18
#permalink

Спасибо, очень полезный сайт, но документации по DOM все же не хватает, это еще не так хорошо изученное направление.


Автор: Гость (не зарегистрирован), дата: 13 ноября, 2014 - 15:21
#permalink

Помогите please с заданием,обработать массив строк,сформировать содержание,,используя JavaScript Разбить список на 2 уровня,первый уровень-первая буква,второй соответственно строка на эту букву.При нажатии на 2й уровень должна загружатся страница в который расположить справа.СПАСИБО


Автор: kostya4031 (не зарегистрирован), дата: 23 ноября, 2014 - 04:36
#permalink

Задание ещё актуально, могу помочь но нужно более точно описать задание, а то вы как то очень расплывчато всё описали


Автор: Delpini22, дата: 16 августа, 2020 - 09:33
#permalink

Generally petroleum general marshal rasinski federacia kriminalnaia Muir roosia Prezident Tornike devnozashvili na Vladimir vladimerovich putina


Автор: yuran1174, дата: 13 апреля, 2016 - 10:59
#permalink

Люди, помогите пожалуйста ) Используя JavaScript, HTML и объектную модель документа (DOM) обеспечить размещение абзаца на HTML-странице по левому краю, по центру и по правому краю. Для доступа к абзацу использовать метод getElementById().(должно быть 3 кнопки по нажатию которых абзац меняет положение лево центр право )


Автор: Гость (не зарегистрирован), дата: 12 июня, 2018 - 21:09
#permalink

постоянно используется при создании сайтов.


Автор: Hank (не зарегистрирован), дата: 16 июня, 2020 - 21:35
#permalink

thanks, true. It was used when creating my site: fence companies rochester ny


Автор: Гость (не зарегистрирован), дата: 20 октября, 2018 - 07:06
#permalink
[css]
[/css]

Автор: Adela Anne (не зарегистрирован), дата: 20 апреля, 2020 - 11:48
#permalink

Thanks so much for the information you shared in this article! I am sure many will find many such useful things on this site as well. basketball stars


Автор: furia77 (не зарегистрирован), дата: 25 августа, 2020 - 02:21
#permalink

Thanks for sharing the information I like how you explain it in an easy way I am always willing to learn with the current elements and tools catalogos ofertas


Автор: 먹튀검증커뮤니티 (не зарегистрирован), дата: 22 ноября, 2020 - 05:33
#permalink

Wow what a Great Information about World Day its very nice informative post. thanks for the post 먹튀검증커뮤니티


Автор: 소액대출 (не зарегистрирован), дата: 22 ноября, 2020 - 05:34
#permalink

Thanks for your information, it was really very helpfull 소액대출


Автор: Гость (не зарегистрирован), дата: 22 декабря, 2020 - 21:06
#permalink

These reasons to learn English just makes sense. It is pretty useful when it comes to the real world because it is the universal medium when it comes to business and the world of information technology. It is a pretty useful tool when it comes to getting bed wars unblocked and when coding for a lot of companies because they typically use English to communicate to each other. That is probably why English should be taught early on a child’s life to secure their future careers. You can learn tips and tricks to better learn the language from this game source.


Автор: 먹튀검증사이트 (не зарегистрирован), дата: 8 января, 2021 - 09:08
#permalink

What a nice comment!Nice to meet you. I live in a different country from you. Your writing will be of great help to me and to many other people living in our country. I was looking for a post like this, but I finally found 먹튀검증사이트.


Автор: sexkontakt duisburg (не зарегистрирован), дата: 11 февраля, 2021 - 09:25
#permalink

You must to try sexkontakt duisburg - the best web place for free sexy chat with hot ladies, and you will not regret it!


Автор: 카지노사이트 (не зарегистрирован), дата: 17 марта, 2021 - 06:47
#permalink

I am contemplating this topic. I think you can solve my problems. My site is at "카지노사이트". I hope you can help me.


Автор: Гость토토사이트 (не зарегистрирован), дата: 20 марта, 2021 - 12:05
#permalink

It was an awesome post to be sure. I completely delighted in understanding it in my noon. Will without a doubt come and visit this blog all the more frequently. A debt of gratitude is in order for sharing. 토토사이트


Автор: 먹튀검증 (не зарегистрирован), дата: 31 марта, 2021 - 10:57
#permalink

Your article has answered the question I was wondering about! I would like to write a thesis on this subject, but I would like you to give your opinion once 먹튀검증


Автор: 토토사이트 (не зарегистрирован), дата: 1 апреля, 2021 - 07:13
#permalink

I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. 토토사이트 Thanks for sharing this wonderful information.


Автор: 안전놀이터 (не зарегистрирован), дата: 2 апреля, 2021 - 12:28
#permalink

Hello! Nice to meet you, I say . The name of the community I run is 안전놀이터, and the community I run contains articles similar to your blog. If you have time, I would be very grateful if you visit my site .


Автор: 메이저놀이터 (не зарегистрирован), дата: 5 апреля, 2021 - 07:34
#permalink

I was looking for another article by chance and found your article 메이저놀이터 I am writing on this topic, so I think it will help a lot. I leave my blog address below. Please visit once.


Автор: 메이저놀이터 (не зарегистрирован), дата: 5 апреля, 2021 - 07:36
#permalink

There are also articles on these topics on my blog and I hope you visit once and have a deep discussion! 메이저놀이터


Автор: 메이저놀이터 (не зарегистрирован), дата: 5 апреля, 2021 - 07:37
#permalink

It was an awesome post to be sure. I completely delighted in understanding it in my noon. Will without a doubt come and visit this blog all the more frequently. A debt of gratitude is in order for sharing. 메이저놀이터


Автор: 토토디비 (не зарегистрирован), дата: 5 апреля, 2021 - 07:39
#permalink

Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information. 토토디비


Автор: 먹튀검증 (не зарегистрирован), дата: 9 апреля, 2021 - 11:44
#permalink

Your writing is perfect and complete. 먹튀검증 However, I think it will be more wonderful if your post includes additional topics that I am thinking of. I have a lot of posts on my site similar to your topic. Would you like to visit once?


Автор: Packaging Printers (не зарегистрирован), дата: 10 апреля, 2021 - 15:57
#permalink

Thanks for your nice post I really like it and appreciate it. My work is about Packaging Printers
. If you need perfect quality boxes then you can visit our website.


Автор: 먹튀검증 (не зарегистрирован), дата: 11 апреля, 2021 - 12:13
#permalink

Your article is great, but I think it will be more complete if you add some topics to this article. I have these types of articles on my blog too. Would you like to visit them?먹튀검증


Автор: 안전놀이터 (не зарегистрирован), дата: 13 апреля, 2021 - 13:15
#permalink

When did you start writing articles related to ? To write a post by reinterpreting the 안전놀이터 I used to know is amazing. I want to talk more closely about , can you give me a message?


Автор: 안전놀이터 (не зарегистрирован), дата: 16 апреля, 2021 - 05:12
#permalink

I would like to thank you for the efforts you have put in penning this site. I’m hoping to view the same high-grade content by you later on as well. In truth, your creative writing abilities has motivated me to get my own, personal website now. 안전놀이터


Автор: 토토사이트 (не зарегистрирован), дата: 26 апреля, 2021 - 10:33
#permalink

I finally found what I was looking for! I'm so happy. 토토커뮤니티 Your article is what I've been looking for for a long time. I'm happy to find you like this. Could you visit my website if you have time? I'm sure you'll find a post of interest that you'll find interesting.


Автор: 먹튀검증 (не зарегистрирован), дата: 27 апреля, 2021 - 05:10
#permalink

I've been using this kind of hobby lately, so take a look.먹튀검증


Автор: Custom Mailer Boxes (не зарегистрирован), дата: 29 апреля, 2021 - 09:22
#permalink

Your website is a gift for me.It contains all the information I want to know.My website Custom Mailer Boxes works just like yours.You must visit it if you like it.


Автор: customized packaging custom boxes (не зарегистрирован), дата: 1 мая, 2021 - 12:37
#permalink

Your site is very good today. My work is according to you.If you want to check out my site please visit my site customized packaging custom boxes


Автор: 토토사이트 (не зарегистрирован), дата: 2 мая, 2021 - 06:15
#permalink

Howdy! Do you know if they make any plugins to assist with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Cheers! 토토사이트


Автор: 토토사이트 (не зарегистрирован), дата: 4 мая, 2021 - 10:23
#permalink

You made some good points there. I did a Google search about the topic and found most people will believe your blog. 토토사이트


Автор: 메이저놀이터 (не зарегистрирован), дата: 5 мая, 2021 - 11:43
#permalink

I don't know how many hours I've been searching for a simple article like this. Thanks to your writing, I am very happy to complete the process now. 메이저놀이터


Автор: 메이저토토사이트 (не зарегистрирован), дата: 10 мая, 2021 - 06:02
#permalink

It'ѕ fantastic that you ɑre ɡetting tһoughts from this 메이저토토사이트 as well aѕ from oour discussion madе at tһis рlace.


Автор: Minecraft Classic (не зарегистрирован), дата: 10 мая, 2021 - 11:04
#permalink

I'm sure you won't be disappointed when you join this very special game, it will make you happier Minecraft Classic


Автор: 먹튀검증사이트 (не зарегистрирован), дата: 11 мая, 2021 - 09:32
#permalink

I will bookmark this site and come to it from time to time. Your writing has been of great help to me.먹튀검증사이트


Автор: 토토커뮤니티 (не зарегистрирован), дата: 12 мая, 2021 - 05:36
#permalink

Your ideas inspired me very much. 토토커뮤니티It's amazing. I want to learn your writing skills. In fact, I also have a website. If you are okay, please visit once and leave your opinion. Thank you.


Автор: 바카라사이트 (не зарегистрирован), дата: 20 мая, 2021 - 05:59
#permalink

The article composing business is going extraordinary for me at this moment, and the vast majority of my prosperity is because of the substance that you post here. I utilize your substance to compose my articles, and the substance makes my great article incredible. 바카라사이트


Автор: 토토커뮤니티 (не зарегистрирован), дата: 22 мая, 2021 - 05:36
#permalink

What a post I've been looking for! I'm very happy to finally read this post. 토토커뮤니티 Thank you very much. Can I refer to your post on my website? Your post touched me a lot and helped me a lot. If you have any questions, please visit my site and read what kind of posts I am posting. I am sure it will be interesting.


Автор: 먹튀검증사이트 (не зарегистрирован), дата: 22 мая, 2021 - 10:50
#permalink

I needed several examples to write an article on this subject, and your article was of great help to me.먹튀검증사이트


Автор: 먹튀검증사이트 (не зарегистрирован), дата: 22 мая, 2021 - 16:14
#permalink

This site contains a lot of really good information. Lots of useful inaformation. 먹튀 I'll add it to my bookmarks and stop by often. Maybe other visitors will think the same way as me. I hope you have a nice day today. Oh, it would be nice to visit our site and receive useful information. 먹튀검증사이트


Автор: 토토사이트 (не зарегистрирован), дата: 23 мая, 2021 - 05:43
#permalink

I love what you 토토사이트 tend to be up too. This kind of clever work and exposure! Keep up the excellent works guys I've incorporated you guys to our blogroll.


Автор: 메이저토토사이트 (не зарегистрирован), дата: 24 мая, 2021 - 09:49
#permalink

Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites 메이저토토


Автор: 메이저놀이터 (не зарегистрирован), дата: 24 мая, 2021 - 09:56
#permalink

The vacation trades offered are evaluated a variety of in the chosen and simply good value all around the world. Those hostels are normally based towards households which you’ll find accented via charming shores promoting crystal-clear fishing holes, concurrent of one’s Ocean. Hotels Discounts 메이저안전놀이터


Автор: 메이저놀이터 (не зарегистрирован), дата: 24 мая, 2021 - 09:58
#permalink

After looking for printing services that have fast and quality work, I could say that this one is what I would really recommend. After being in the field for years, this really helped me and my business be efficient in all aspects possible. 안전놀이터Check out this


Автор: scottish sex contacts (не зарегистрирован), дата: 8 июня, 2021 - 06:57
#permalink

scottish sex contacts is web place made for your sexy chat pleasure with hot local ladies in United Kingdom, so visit us and you will not regret it


Автор: pioneerseo (не зарегистрирован), дата: 11 июня, 2021 - 05:39
#permalink

CryptoBite.io brings you the latest news and everything you need to know about crypto. Check out our virtual cryptocurrency trading competition and NFTs. Cryptocurrency Trading Competition


Автор: pioneerseo (не зарегистрирован), дата: 14 сентября, 2021 - 05:11
#permalink

Over 20  Years of Experience in Serving Peoples. ONBOARD IT TECH specializes in providing high quality low voltage work covering from security camera installation to home theater installation to networking and much more. We work with small businesses to large corporations, ONBOARD IT TECH has the skills and know-how to ensure that your business can succeed in today’s increasingly competitive marketplace. doorbird installer near me


Автор: Bóng88 (не зарегистрирован), дата: 10 июля, 2021 - 12:17
#permalink

There must have been many difficulties in providing this information.Bóng 88 Nevertheless, thank you for providing such high-quality information.


Автор: 메이저사이트 (не зарегистрирован), дата: 18 июля, 2021 - 10:47
#permalink

Good morning!! I am also blogging with you. In my blog, articles related to are mainly written, and they are usually called 메이저사이트 If you are curious about , please visit!!


Автор: 먹튀검증사이트 (не зарегистрирован), дата: 19 июля, 2021 - 11:27
#permalink

Great post! I am actually getting ready to across this information,is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here!


Автор: Bóngđộ (не зарегистрирован), дата: 20 июля, 2021 - 05:19
#permalink

Your information was very useful to me. That's exactly what I've been looking for Bóngđộ!


Автор: sex (не зарегистрирован), дата: 23 июля, 2021 - 09:45
#permalink

Hello ! I am the one who writes posts on these topicssex I would like to write an article based on your article. When can I ask for a review?


Автор: Tàixỉu (не зарегистрирован), дата: 30 июля, 2021 - 07:09
#permalink

Of course, your article is good enough, Tàixỉu but I thought it would be much better to see professional photos and videos together. There are articles and photos on these topics on my homepage, so please visit and share your opinions.


Автор: 메이저놀이터추천 (не зарегистрирован), дата: 8 августа, 2021 - 07:29
#permalink

We are looking for a lot of data on this item. In the meantime, this is the perfect article I was looking for . Please post a lot about items related to 메이저놀이터추천 !!! I am waiting for your article. And when you are having difficulty writing articles, I think you can get a lot of help by visiting my .


Автор: 안전놀이터순위 (не зарегистрирован), дата: 24 августа, 2021 - 06:42
#permalink

I'm so happy to finally find a post with what I want. 안전놀이터순위 You have inspired me a lot. If you are satisfied, please visit my website and leave your feedback.


Автор: 메이저사이트모음 (не зарегистрирован), дата: 2 сентября, 2021 - 06:27
#permalink

Many thanks for the article, I have a lot of spray lining knowledge but always learn something new. Keep up the good work and thank you again. 메이저사이트모음


Автор: 메이저토토사이트 (не зарегистрирован), дата: 3 сентября, 2021 - 09:49
#permalink

I gain infinite trust in your writing 메이저토토사이트
I'm thinking about applying it to my blog with reference to that article. Have a nice day."


Автор: 메이저안전놀이터 (не зарегистрирован), дата: 5 сентября, 2021 - 09:17
#permalink

Your ideas inspired me very much. 메이저안전놀이터 It's amazing. I want to learn your writing skills. In fact, I also have a website. If you are okay, please visit once and leave your opinion. Thank you.


Автор: 메이저토토사이트모음 (не зарегистрирован), дата: 6 сентября, 2021 - 09:32
#permalink

Your ideas inspired me very much. 메이저토토사이트모음 It's amazing. I want to learn your writing skills. In fact, I also have a website. If you are okay, please visit once and leave your opinion. Thank you.


Автор: 안전놀이터추천 (не зарегистрирован), дата: 7 сентября, 2021 - 09:47
#permalink

Hello, I read the post well. 안전놀이터추천 It's a really interesting topic and it has helped me a lot. In fact, I also run a website with similar content to your posting. Please visit once


Автор: Shemale Sex Club (не зарегистрирован), дата: 7 сентября, 2021 - 17:59
#permalink

Shemale Sex Club is the most popular web page in United Kingdom for a free chat with local girls


Автор: mili (не зарегистрирован), дата: 7 сентября, 2021 - 22:52
#permalink

Спасибо, что поделились, информация кажется очень полезной. catalogos price shoes


Автор: 토토검증 (не зарегистрирован), дата: 11 сентября, 2021 - 06:51
#permalink

This is very interesting, You are a very professional blogger. I’ve joined your feed and look ahead to seeking more of your excellent post. Additionally, I’ve shared your web site in my social networks. 토토검증


Автор: stroyka-gid.ru/ (не зарегистрирован), дата: 20 сентября, 2021 - 15:50
#permalink

Автор: sk-blagodat.ru/ (не зарегистрирован), дата: 20 сентября, 2021 - 15:50
#permalink

Автор: gatewit.com/ (не зарегистрирован), дата: 20 сентября, 2021 - 15:51
#permalink

Отправить комментарий

Приветствуются комментарии:
  • Полезные.
  • Дополняющие прочитанное.
  • Вопросы по прочитанному. Именно по прочитанному, чтобы ответ на него помог другим разобраться в предмете статьи. Другие вопросы могут быть удалены.
    Для остальных вопросов и обсуждений есть форум.
P.S. Лучшее "спасибо" - не комментарий, как все здорово, а рекомендация или ссылка на статью.
Содержание этого поля является приватным и не предназначено к показу.
  • Адреса страниц и электронной почты автоматически преобразуются в ссылки.
  • Разрешены HTML-таги: <strike> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <u> <i> <b> <pre> <img> <abbr> <blockquote> <h1> <h2> <h3> <h4> <h5> <p> <div> <span> <sub> <sup>
  • Строки и параграфы переносятся автоматически.
  • Текстовые смайлы будут заменены на графические.

Подробнее о форматировании

CAPTCHA
Антиспам
9 + 5 =
Введите результат. Например, для 1+3, введите 4.
 
Текущий раздел
Поиск по сайту
Содержание

Учебник javascript

Основные элементы языка

Сундучок с инструментами

Интерфейсы

Все об AJAX

Оптимизация

Разное

Дерево всех статей

Последние комментарии
Последние темы на форуме
Forum