Home

JQuery remove element

jQuery Remove Elements - W3School

Before jQuery version 1.12/2.2, the .removeClass() method manipulated the className property of the selected elements, not the class attribute.Once the property was changed, it was the browser that updated the attribute accordingly. This means that when the class attribute was updated and the last class name was removed, the browser might have set the attribute's value to an empty string. The .removeData() method allows us to remove values that were previously set using .data().When called with the name of a key, .removeData() deletes that particular value. When called with no arguments, .removeData() removes all values. Note that .removeData() will only remove data from jQuery's internal .data() cache, and any corresponding data-attributes on the element will not be removed Type: String. An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. The .removeAttr () method uses the JavaScript removeAttribute () function, but it has the advantage of being able to be called directly on a jQuery object and it accounts for different attribute naming across browsers jQuery remove elements using empty(), remove(), unwrap() Method - how to use this method for remove selected html elements. Here, You will learn how to remove the selected HTML elements or its contents using jQuery. Also remove its attribute to the document Removing elements from the page using the empty (), remove (), detach () and unwrap () methods. Replacing elements with new elements by using the replaceWith () and replaceAll () methods, and. How to move an element from one parent element in the page to another. Once you've read this tutorial, you'll have mastered all the jQuery techniques.

jQuery remove() Method - W3School

The .css () jQuery method is used to set or return one or more style properties for the selected elements. The .removeAttr () jQuery method removes an attribute from each element in the collection of matched elements.The method uses the JavaScript removeAttribute () function, but it is capable of being called directly on a jQuery object Removing Existing Elements; Read and Modifying Content; With jQuery you can add and remove HTML elements on a page, and modify their content. Adding New Elements There are two ways to add new elements in a web page, you can create the element and then insert it in the page to a specific location, or you can directly add the HTML item in the page You can use jQuery removeAttr function to remove attributes from HTML element using jQuery. To do this, you need to only specify the id the HTML element.In addition to this, you also need to specify the attribute you want to remove. Also, define the click event on which you have to remove the HTML element

JQuery, remove element from string - Stack Overflo

Books. Learning jQuery Fourth Edition Karl Swedberg and Jonathan Chaffer jQuery in Action Bear Bibeault, Yehuda Katz, and Aurelio De Rosa jQuery Succinctly Cody Lindle Definition and Usage. The off() method is most often used to remove event handlers attached with the on() method. As of jQuery version 1.7, the off() method is the new replacement for the unbind(), die() and undelegate() methods. This method brings a lot of consistency to the API, and we recommend that you use this method, as it simplifies the jQuery code base Tryit Editor v3.6. ×. Change Orientation Save Code Change Theme, Dark/Light To remove several classes, separate the class names with space. Note: If this parameter is empty, all class names will be removed. function (index,currentclass) Optional. A function that returns one or more class names to remove. index - Returns the index position of the element in the set. currentclass - Returns the current class name of. 기존 요소의 내부에 추가 다음 메소드를 사용하면 기존 요소의 내부에 새로운 요소나 콘텐츠를 추가할 수 있다. 메소드 설명 .append() 선택된 요소의 마지막에 새로운 요소나 콘텐츠를 추가한다. .prepend() 선택.

Element.remove () is unscopable. The remove () method is not scoped into the with statement. See Symbol.unscopables for more information. with( node) { remove(); } Copy to Clipboard http://technotip.com/2021/append-add-and-remove-html-xml-elements-jquery/Video tutorial to illustrate adding or appending an html element or removing an html.. To remove an attribute from each tag using jQuery, use the removeAttr() method and use the Universal Selector. Let us see how to use the method to remove all style attribute. Use the universal selector also to select all the elements. You can try to run the following code to learn how to remove all style attributes using jQuery

jQuery / Method / .remove() - 선택한 요소를 제거하는 메서드 - CODING ..

Using Splice to Remove Array Elements in JavaScript. The splice method can be used to add or remove elements from an array. The first argument specifies the location at which to begin adding or removing elements. The second argument specifies the number of elements to remove jQuery remove() 方法. jQuery remove() 方法删除被选元素及其子元素。 实例 $(#div1).remove(); 亲自试一 jQueryでDOM要素を削除する方法を紹介します。 jQueryの要素の削除に使えるメソッドには、remove()とempty()、さらにunwrap()、の4つがあります。 以下のHTMLを使い「要素を消す」ボタンをクリックすることで、要素が削除される例で説明します I click on Remove h1 element using the name and the button searches for h1 from HTML and removes. So here, we removed the HTML element using ID, class name, or HTML element using jQuery. See the below screenshot to see how the HTML looks

.remove()를 사용하면 요소 자체 뿐만 아니라 그 안에 있는 모든 요소들이 제거됩니다. 추가적으로 요소들과 연관된 모든 이벤트와 jQuery 데이터들도 모두 제거됩니다 In this tutorial you can learn how to Add, Cange, and Remove Attributes (like id, class, href, disabled, etc.) in HTML elements using jQuery. All these actions can be performed using the attr(), and removeAttr() jQuery methods.. Add attribute To add an attribute to a HTML element /or elements (any attribute, id, class, href, selected, etc.), apply this syntax jQuery / Method / .empty() - 선택한 요소의 내용을 지우는 메서드.empty() .empty()는 선택한 요소의 내용을 지웁니다. 내용만 지울 뿐 태그는 남아있다는 것에 주의합니다. 태그를 포함한 요소 전체를 제거할 때는 .remove()를 사용합니다 JQuery makes it very easy to select specific elements and their attributes in your web page HTML. In the following tutorial I will show you how to use just a few lines of jQuery to create an add/remove select list for your website form remove, detach. 특정 태그를 제거합니다. remove는 완전히 제거해버리지만, detach는 잠시 제거하는 겁니다. 변수에 저장해두었다가 나중에 appendTo로 다시 붙이면 됩니다. (jQuery) 태그 생성, 추가, 복사, 이동,.

15 Best and useful jQuery pluginsCreate And Handle HTML Forms With jQuery Reform

JSON 객체에 키(key)와 값(value)를 추가하고 삭제하는 방법 var json = {NAME: John, AGE: 30, SEX: male}; //add item (key, value) json.BIRTHDAY. Earlier I had posted about jQuery solution to Find index of element in array, split an array, combine/join arrays and remove duplicate items from array, And In this post, find how to remove item from array with example. Below code will remove the item from the array by its value (not by index) jQuery / Method / .click() - 선택한 요소를 클릭했을 때 특정 작업을 하는 메서드.click() .click()은 선택한 요소를 클릭했을 때 특정 작업을 수행할 수 있게 하는 속성입니다. 문법 .click( handler ) 예를 들어 button 요소를 클릭했을 때 함수를 실행시키고 싶으면 다음과 같이 합니다. $( 'button' ).click( function. jQuery :disabled Selector - you can use jQuery prop() method to disable or enable input elements/form elements dynamically using jQuery July 04, 2011. jQuery. Sometimes you need to disable/enable the form element like input or textarea. Jquery helps you to easily make this with setting disabled attribute to disabled. For e.g.: //To disable. $ ('.someElement').attr ('disabled', 'disabled'); To enable disabled element you need to remove disabled attribute from this element or.

.attr() .attr()은 요소(element)의 속성(attribute)의 값을 가져오거나 속성을 추가합니다. 문법 1 .attr( attributeName ) 선택한 요소의 속성의 값을 가져옵니다. 예를 들어 $( 'div' ).attr( 'class' ); 는 div 요소의 class 속성의 값을 가져옵니다. 문법 2 .attr( attributeName, value ) 선택한 요소에 속성을 추가합니다 jQuery remove() Method. The jQuery remove() method removes the selected elements from the DOM as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. The following example will remove all the <p> elements with the class .hint from the DOM on button click. . Nested elements inside these paragraphs will.

jQuery remove style inline CSS: Here in this article, we learn how we remove inline style CSS property in jQuery. While developing a website if we have used any themes for our design, we have found that our HTML tags may be div tags or any other element that has some unnecessary inline style. This inline style makes our page design dirty To use this technique for other tags, simply replace span and p with the child and parent elements that you want to remove when empty. Note that this technique removes only the first matching empty tags (like the WordPress example). To target and remove multiple empty elements, check out the next section. Remove multiple empty elements link Moving, Copying, and Removing Elements. While there are a variety of ways to move elements around the DOM, there are generally two approaches: Place the selected element(s) relative to another element. Place an element relative to the selected element(s). For example, jQuery provides .insertAfter() and .after().The .insertAfter() method places the selected element(s) after the element. If the class already present in the selected HTML element, jQuery toggleClass () remove the class and if not present, it adds the CSS class from the HTML element. When you click the below button, it add/remove the class 'toggleclass' from the below p element. This is the jQuery Tutorial of toggle CSS class Introduction to jQuery remove() The method used to remove selected elements and everything inside it is called jQuery remove method. Data and events of the elements is also removed from the domain. All the text and child nodes is removed as well as the bound elements of the process

+ Recent posts [엑셀] 사용자지정서식 활용하기; 시퀀서 / 시퀀서 장비 Throug⋯; NodeJs / npm 업데이트 중 오류; JAVA/ Float 소수점 자리 출 jQuery Add and Remove CSS Classes. In this tutorial you will learn how to add or remove CSS classes using jQuery. jQuery CSS Classes Manipulation. jQuery provides several methods, such as addClass(), removeClass(), toggleClass(), etc. to manipulate the CSS classes assigned to HTML elements.. jQuery addClass() Method. The jQuery addClass() method adds one or more classes to the selected elements Given an HTML element and the task is to add and remove multiple classes from it using JQuery. Approach: First select the element to which multiple classes will be added. Then use addClass() method to add multiple classes to the element and removeClass() method to remove multiple classes.. Example 1: This example add two classes color and fontWeight to the selected element using addClass() method jQuery's each () function is used to loop through each element of the target jQuery object — an object that contains one or more DOM elements, and exposes all jQuery functions. It's very. jQuery remove () The jQuery remove () method is used to remove the selected elements out of the DOM. It removes the selected element itself, as well as everything inside it (including all texts and child nodes). This method also removes the data and the events of the selected elements. If you want to remove elements without removing data and.

jQuery 입문 요소의 조작 요소의 삭제

The removeClass() Method¶. The most used method to remove all item's classes is the removeClass() jQuery method. This method removes a single, multiple or all classes from each element in the set of matched elements. If a class name is specified as a parameter, only that class will be removed from the set of matched elements jQuery delete table row on click: This article explains how to remove selected table row .i.e how to delete table row by id or class-name on button click event in jQuery. On button click, we remove the selected row/tr maybe it's dynamically added table row or already available on DOM. Using the jQuery `.on()` method will be able to select dynamically added elements by specifying their class. How do I check/uncheck a checkbox input or radio button? You can check or uncheck a checkbox element or a radio button using the .prop () method: 1. 2. 3

.off() jQuery API Documentatio

  1. jQuery - 删除元素 通过 jQuery,可以很容易地删除已有的 HTML 元素。 删除元素/内容 如需删除元素和内容,一般可使用以下两个 jQuery 方法: remove() - 删除被选元素(及其子元素) empty() - 从被选元素中删除子元素 jQuery remove() 方法 jQuery remove() 方法删除被选元素及其子元素
  2. In the first example, .index() gives the zero-based index of #foo1 within its parent. Since #foo1 is the second child of its parent, index() returns 1.. Note: Before jQuery 1.9, .index() only worked reliably on a single element, which is why we've used .first() on each of our examples. In jQuery 1.9+ this can be ignored, as the API was updated to define that it operates on the first element only
  3. Hi everyone, it seems there is an issue with remove(), it used to work fine but doesn't anymore with the following syntax : $(parent).remove(child). Thi
  4. Removing DOM Elements. There may be a situation when you would like to remove one or more DOM elements from the document. JQuery provides two methods to handle the situation. The empty( ) method remove all child nodes from the set of matched elements where as the method remove( expr ) method removes all matched elements from the DOM.. Here is the syntax for the method
  5. 如果给定表示 DOM 元素集合的 jQuery 对象,.closest () 方法允许我们检索 DOM 树中的这些元素以及它们的祖先元素,并用匹配元素构造新的 jQuery 对象。. .parents () 和 .closest () 方法类似,它们都沿 DOM 树向上遍历。. 两者之间的差异尽管微妙,却很重要:. 沿 DOM 树向上.
  6. Answer: Use the jQuery unwrap () method. Sometime you might require to remove the wrapper or parent element, a typical example is removing the anchor tag around the text. With jQuery unwrap () method you can easily remove the wrapper element and keep the inner HTML or text content intact
  7. g. The dialog widget uses the jQuery UI CSS framework to style its look and feel. If dialog specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-dialog: The outer container of the dialog
CSS and jQuery Simple confirmation popup | CodyHouse

SumoSelect is a jquery plugin which beautifully renders a single or multiple HTML select element. Its cross device, cross browser all in one solution for complex select related problems. fully customizable and a vast set of functions The jQuery val() method can be used to return or set the value attribute of the selected element. You can use this method for the elements inside the form tag to get or assign a value to them jQuery detects this state of readiness for you. Code included inside $ ( document ).ready () will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute. Code included inside $ ( window ).on ( load, function () { }) will run once the entire page (images or iframes), not just the DOM, is ready jQuery supports method chaining and you can remove all existing click handlers and assign a new click handler all at one go. The following example would clear all the click event handlers from #myelement and assign a new one: This is safe to use and will not cause any errors if no click events have already been bound to the element jQuery UI Draggable + Sortable. Revert position. Snap to element or grid. Visual feedback. jQuery UI Draggable - Default functionality. Drag me around. Enable draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport. view source

Element.classList. The Element.classList is a read-only property that returns a live DOMTokenList collection of the class attributes of the element. This can then be used to manipulate the class list. Using classList is a convenient alternative to accessing an element's list of classes as a space-delimited string via element.className node is the parent node of child. oldChild holds a reference to the removed child node, i.e., oldChild === child. The removed child node still exists in memory, but is no longer part of the DOM. With the first syntax form shown, you may reuse the removed node later in your code, via the oldChild object reference Feature enable / disable. Disabling features that you don't wish to use for a particular table is easily done by setting a variable in the initialisation object. The full list of available options is available in the DataTables reference. In the following example only the search feature is left enabled (which it is by default)

Theming. The autocomplete widget uses the jQuery UI CSS framework to style its look and feel. If autocomplete specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-autocomplete: The menu used to display matches to the user. ui-autocomplete-input: The input element that the. The remove() method in JQuery used to remove all the selected elements including all the text. This method also remove data and all the events of the selected elements. Syntax: $(selector).remove() Return Value: It will return all the data of the selected elements deleted. Example 1: Input: $(p).remove() Output: Output will be all the elements of the paragraph get deleted How do I remove from the DOM (using jQuery) every option element that does not have a inner html value contained in the above list? For example, given the above list of inner html values ( [Simon, Alex] ), I would like to remove only the <option value=Name 2>Frank</option> and <option value=Name 3>Bob</option> elements, so that the final select element would look like When removing an element with JavaScript, you must go to its parent first instead. This was always odd and not so straightforward. According to DOM level 4 specs, which is the current version in. jQuery API 정복 - 클래스 제거, removeClass() (2) 2011.03.14: jQuery API 정복 - 속성 제거, removeAttr() (0) 2011.03.11: jquery API 정복 - innerHTML 과 같은 표현, html() (10) 2011.03.10: jQuery API 정복 - 클래스가 있나 찾기, hasClass() (5) 2011.03.03: jQuery API 정복 - attr(), 속성을 제어하기 (2) 2011.02.2

Rajandran R Blogs Nifty Futures Continues With Too Many

.removeClass() jQuery API Documentatio

  1. Add/Remove Input Fields Dynamically with jQuery. If you are looking to add and remove duplicate input fields, here's another jQuery example below to do the task for you. This jQuery snippet adds duplicate input fields dynamically and stops when it reaches maximum. If you read comment lines carefully, the process is pretty straight forward
  2. To remove the visible class from the div element, you use the following code: const div = document.querySelector('div'); div.classList.remove('info'); Code language: JavaScript (javascript) The remove() method also allows you to remove multiple classes at once, like this
  3. innerHTML 내용설정: - DOM객체.innerHTML = 내용; - jQuery객체.html(내용); 내용확인: - DOM객체.innerHTML; - jQuery객체.html(); innerTEXT 내용.
  4. Adding, removing and toggle class in HTML elements To add, remove or update the class(es) attached to HTML elements, you may use the jQuery and JavaScript. The jQuery has addClass, removeClass and hasClass methods that can be used for adding, removing or updating the classes. Similarly, you may use the className and classList attributes of JavaScript, [
  5. Note: Selecting all elements in the page via a wildcard query could be slow, depending on how many elements are in the page. You could use a smaller set of elements to be more performant: var set = document.getElementById('foo').getElementsByTagName('bar'); remove_style(set)
  6. jQuery: The Write Less, Do More, JavaScript Library. Ajax. Call a local script on the server /api/getWeather with the query parameter zipcode=97201 and replace the element #weather-temp's html with the returned text
  7. How to add/remove class to/from an element in JavaScript. A quick tutorial on how to add, remove and toggle classes in JavaScript

Usage notes. You should use removeAttribute () instead of setting the attribute value to null either directly or using setAttribute (). Many attributes will not behave as expected if you set them to null. DOM methods dealing with element's attributes: Not namespace-aware, most commonly used methods. Namespace-aware variants (DOM Level 2 Removing jQuery from GitHub.com frontend. We have recently completed a milestone where we were able to drop jQuery as a dependency of the frontend code for GitHub.com. This marks the end of a gradual, years-long transition of increasingly decoupling from jQuery until we were able to completely remove the library [jquery] 스크롤 끝까지 갔는지 체크하기 (0) 2011.03.25: jQuery UI Sortable Tutorial (0) 2011.02.21: jquery 객체 비교하기 (jQuery.equals How To Compare DOM Elements) (1) 2011.02.07: 비트이동 예제... (0) 2008.09.0 In order to clear a dropdownlist items using JQuery: $ ('#ddlMyCombo >option').remove (); for more about the JQuery Seletor expressions take a look on my post JQuery Selector Expressions Demystified. What I am doing here is selecting all the option elements that are child of the element with ID #ddlMyCombo which is the dropdownlist id and. In previous articles I have explained How to Remove first, last or selected item from dropdown and Remove item by value or text or index from dropdown and S elect all text in asp.net and html textbox on click or focus using jQuery and Add textbox search functionality in checkboxlist using jquery and Difference between .empty() and .remove jquery methods with example

Add, select, or clear items. Creating new options in the dropdown. New options can be added to a Select2 control programmatically by creating a new Javascript Option object and appending it to the control:. var data = { id: 1, text: 'Barn owl' }; var newOption = new Option(data.text, data.id, false, false); $('#mySelect2').append(newOption).trigger('change') In jQuery, there are various methods like - switchClass(), toggleClass(), addClass() and removeClass() by using them you can easily add or removes classes in the elements. For using switchClass() method you need to include jQuery UI library within your page but you can simply use toggleClass(), addClass() and removeClass() without any dependency other than jQuery Dynamically Add/Remove rows in HTML table using jQuery. Step 1 : We will create a new index.html file and include jQuery and Bootstrap library files into head section of index.html file. Step 2: We will add HTML table into index.html file which will contains all records in grid layout.We will append newly dynamically generated row with in body. jQuery provides the unbind () command to remove an exiting event handler. The syntax of unbind () is as follows −. selector .unbind (eventType, handler) or selector .unbind (eventType) Following is the description of the parameters −. eventType − A string containing a JavaScript event type, such as click or submit JQuery bubbles the event from the event target up to the element where the handler is attached from the innermost to outermost element and runs the handler for any elements along that path matching the selector. Conclusion. jQuery makes it fairly easy to bind and remove event handlers either when the page loads, or at runtime

.removeData() jQuery API Documentatio

  1. jQuery Practical Exercises with Solution: Delete all table rows except first one using jQuery. w3resource. home Front End HTML CSS JavaScript HTML5 Schema.org php.js Twitter Bootstrap Responsive Web Design tutorial Zurb Foundation 3 tutorials Pure CSS HTML5 Canvas JavaScript Course Icon Angular React Vue Jest Mocha NPM Yarn.
  2. jQuery add style to the HTML element using css () method. There are two parameters you have to use with this method. The first parameter requires the jQuery selector to specify the id or class of the HTML element and access the element. The second parameter requires property name with its value. See jQuery css () method to look for syntax
  3. Remove item (number or string) from array, using jQuery (method grep)
  4. Description: jQuery provides some interesting methods that would help remove items (options) from dropdown. We can remove all the items, multiple items or remove specific (single) item, remove all except first, remove all except last, remove all except one, remove first item, remove last item, remove selected item, remove item by item text/value/index as per requirement
  5. function Remove_options() { $('#myColor') .empty() .append('<option selected=selected value=test>White</option>'); } See the Pen jquery-practical-exercise-15 by w3resource (@w3resource) on CodePen. Contribute your code and comments through Disqus. Previous: Add a list elements within an unordered list element using jQuery
  6. The draggable widget uses the jQuery UI CSS framework to style its look and feel. If draggable specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-draggable: The draggable element. When the draggable is disabled, the ui-draggable-disabled class is added

Delete the selected row from the DataTable. Description. This method (and its plural counterpart, rows().remove()) will remove the selected row from the DataTable completely, deleting the allocated memory for data and node from the browser. Please be aware that this method removes the data from the table internally but that action won't be visually shown until the draw() method is called to. jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice If you put a tiny delay between removing and re-adding the class (e.g. setTimeout()), it will work, but I think it goes without saying that that isn't ideal. What you really need to do is remove the element from the page entirely and re-insert it. As a quick demo with jQuery, we'll clone it, insert it right after itself, then remove the. jquery-addable.js. A simple jquery library for dynamically adding and removing DOM elements such as form fields. Features. Add or remove any element by selector when the 'add' control element is clicked. Easily remove parent of the 'remove' control element

Element의 메소드 getElementsByClassName() 는 주어진 클래스를 가진 모든 자식 엘리먼트의 실시간 HTMLCollection 을 반환합니다.. Document의 getElementsByClassName() (en-US) 메소드는 도큐먼트 루트로부터 도큐먼트 전체를 탐색한다는 점을 제외하고는 동일하게 작동합니다 Theming. The sortable widget uses the jQuery UI CSS framework to style its look and feel. If sortable specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-sortable: The sortable element The selectable widget uses the jQuery UI CSS framework to style its look and feel. If selectable specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option: ui-selectable: The selectable element. ui-selectee: One of the selectable elements, as specified through the filter option The jQuery UI Slider plugin makes selected elements into sliders. There are various options such as multiple handles and ranges. The handle can be moved with the mouse or the arrow keys. The slider widget will create handle elements with the class ui-slider-handle on initialization. You can specify custom handle elements by creating and appending the elements and adding the ui-slider-handle.

jQuery | find () with Examples. The find () is an inbuilt method in jQuery which is used to find all the descendant elements of the selected element. It will traverse all the way down to the last leaf of the selected element in the DOM tree. Here selector is the selected elements of which all the descendant elements are going to be found jquery; sql; php; 斯卡拉; 珀尔; 语言; html; css; 科特林. cs科目. 数学; 操作系统; 数据库管理系统; 计算机网络; 计算机组织和体系结构; 计算理论; 编译器设计; 数字逻辑; 软件工程. 门. 门 计算机科学笔记; 最后一分钟笔记; 门 cs 已解决的论文; 门 cs 原始论文和官方密钥. How to remove website from cpanel 분야의 일자리를 검색하실 수도 있고, 20건(단위: 백만) 이상의 일자리가 준비되어 있는 세계 최대의 프리랜서 시장에서 채용을 진행하실 수도 있습니다. 회원 가입과 일자리 입찰 과정은 모두 무료입니다

This futuristic smartwatch will make you look classyLearn SEO The Ultimate Guide For SEO Beginners 2020 - YourBest smart home gadgets to fast track your chores - VENGOS16 Coolest gadgets you have never seen before—latestThe best smart pillows and mattresses to help you sleep