С Новым годом! Форум программистов, компьютерный форум, киберфорум
JavaScript
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.67/3: Рейтинг темы: голосов - 3, средняя оценка - 4.67
0 / 0 / 0
Регистрация: 19.09.2015
Сообщений: 28

Проверьте маленький код JS!

22.10.2015, 01:58. Показов 584. Ответов 2
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
 
<head>
<title>Dynamic HTML</title>
<script type="text/javascript" link="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="C:\Users\111\Desktop\jquery.js"></script>
<link rel="stylesheet" href="C:\Users\111\Desktop\stil.css">
</head>
 
<body>
 
<div class="wrapper">
    <div class="greenline"></div>
    <div class="head"><img src="C:\Users\111\Desktop\icarnegieLogo.png"></div>
        <div class="menu">
                <a href="#">Home</a>
                <a href="#">Page 2</a>
                <a href="#">Page 3</a>
                <a href="#">Page 4</a>
        </div>
    <div id="body">
        <img src="C:\Users\111\Desktop\featureImage.jpg"><br>
 
        <h1 id="one">Main Heading</h1>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
        Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer 
        took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,
        but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s 
        with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing 
        software like Aldus PageMaker including versions of Lorem Ipsum.</p>
        
        <div id="subheading">
            <div class="right1"  style="float:left">
                <h2>Subheading</h2>
                <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer 
                took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.</p>
                <a href="#one">Go Back</a>
            </div>
            <div class="img1" style="float:right">
                <img src="C:\Users\111\Desktop\compass.jpg">
            </div>
            <div class="clear"></div>
        </div>
        
        <div id="subheading">
            <div class="right1" style="float:left">
                <h2>Subheading</h2>
                <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer 
                took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.</p>
                <a href="#one">Go Back</a>
            </div>
            <div class="img1" style="float:right">
                <img src="C:\Users\111\Desktop\pen.jpg">
            </div>
            <div class="clear"></div>
        </div>
        
        <div id="subheading">
            <div class="right1" style="float:left">
                <h2>Subheading</h2>
                <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
                Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer 
                took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.</p>
                <a href="#one">Go Back</a>
            </div>
            <div  class="img1" style="float:right">
                <img src="C:\Users\111\Desktop\microscope.jpg">
            </div>
            <div class="clear"></div>
        </div>
        
    </div>
</div>
 
</body>
 
</html>
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
div.wrapper{
    text-decoration:none;
    font-family:arial,sans-serif;
    width:1800px;
}
 
div.greenline{
    background-color:green;
    width:1800px;
    height:10px;
}
 
div.head{
    width:1800px;
    height:150px;
}
 
.head img{
    padding:40px 0px 40px 80px;
}
 
div.menu{
    width:1220px;
    min-height:30px;
    background-color:black;
    text-align:center;
    padding-left:580px;
}
 
 
.menu a{
    text-decoration:none;
    color:white;
    display:inline-block;
    background-color:#DDDDDD;
    float:left;
    padding:5px 50px;
    border:1px grey solid;
}
 
#body{
    margin-left:400px;
    margin-top:70px;
    width:1000px;
}
 
h1{
    margin-top:120px;
}
h2{
    border-bottom:1px grey solid;
}
 
#subheading{
    margin-top:50px;
    padding-top:20px;
    margin-bottom:50px;
    padding-left:30px;
    background-color:#DDDDDD;
    height:270px;
}
 
 
div.right1{
    width:500px;
}
 
div.img1{
    margin-bottom:50px;
    margin-right:100px;
    margin-top:30px;
    border:5px solid white;
}
 
div.clear{
    float:clear;
}
JavaScript
1
$("div").removeAttr('id')
Вопрос - почему он не убирает все id элемента div? Я начинающий, может я как то не понимаю что такое removeAttr?
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
22.10.2015, 01:58
Ответы с готовыми решениями:

Маленький JS код, а не работает
Где проблема? let colors = ; for( let value of colors.values()) { console.log( value ); } // Консоль выдает //...

Руссифицируйте маленький код?)
Ребят, руссифицируйте пожалуйста маленький код?) callback : function(days, hours, minutes, seconds){ var message =...

Проверьте маленький код
Хотел создать тему по поводу ошибки, но когда писал то нашел решение) #include &lt;iostream&gt; double cel(double); int main() { ...

2
Superposition
 Аватар для Padimanskas
950 / 615 / 256
Регистрация: 27.10.2013
Сообщений: 2,083
22.10.2015, 05:14
JamboProduction, Видимо subheading должен быть классом, а не id. На всякий случай проверил метод в песочнице http://jsfiddle.net/qjnp57gx/ - все работает хорошо)
0
 Аватар для Web-ulyanov
55 / 54 / 24
Регистрация: 07.10.2013
Сообщений: 200
22.10.2015, 08:17
JamboProduction,
Обернуть в функцию нужно, которая сработает после загрузки дерева элементов, чтобы с этими элементами можно было собственно работать потом:
JavaScript
1
2
3
$( document ).ready(function() {
    $("div").removeAttr('id')
});
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
22.10.2015, 08:17
Помогаю со студенческими работами здесь

Как конвертировать (разобраться) маленький PHP код в «псевдо» код?
Доброго времени суток! Я отел бы разобраться в одном алгоритме который к сожалению написан на PHP синтаксис которого мне не ясен. Мог бы...

Маленький код
Добрый день всем ! Прошу помощи в написании маленького кода Имеется три столбца А В С в столбце С последовательная нумерация строк от 1...

Прокоментируйте код маленький
If Application.MessageBox(Pchar('Ви дійсно хочете вилучити запис '+DataModule1.DovidnukTableDSDesigner.AsString), ...

Маленький код а не работает
код из учебника, но что-то не то... A = * 1000 top = 0 x = int(input()) while x != 0: A = x top += 1 x = int(input()) ...

Переписать маленький код с С++
Здравствуйте! Помогите, пожалуйста, переписать код с С++ на С#. Я только начал изучать С#, поэтому не особо получается. Заранее спасибо! ...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Новые блоги и статьи
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Изучаю kubernetes
lagorue 13.01.2026
А пригодятся-ли мне знания kubernetes в России?
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11 — это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11 Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
Почему дизайн решает?
Neotwalker 09.01.2026
В современном мире, где конкуренция за внимание потребителя достигла пика, дизайн становится мощным инструментом для успеха бренда. Это не просто красивый внешний вид продукта или сайта — это. . .
Модель микоризы: классовый агентный подход 3
anaschu 06.01.2026
aa0a7f55b50dd51c5ec569d2d10c54f6/ O1rJuneU_ls https:/ / vkvideo. ru/ video-115721503_456239114
Owen Logic: О недопустимости использования связки «аналоговый ПИД» + RegKZR
ФедосеевПавел 06.01.2026
Owen Logic: О недопустимости использования связки «аналоговый ПИД» + RegKZR ВВЕДЕНИЕ Введу сокращения: аналоговый ПИД — ПИД регулятор с управляющим выходом в виде числа в диапазоне от 0% до. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru