* Replace Jquery -> jQuery * JQuery * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update index.md * Update guide/russian/jquery/jquery-html-method/index.md Co-Authored-By: lipis <lipiridis@gmail.com> * Update guide/russian/jquery/jquery-html-method/index.md Co-Authored-By: lipis <lipiridis@gmail.com>
		
			
				
	
	
	
		
			627 B
		
	
	
	
	
	
	
	
			
		
		
	
	
			627 B
		
	
	
	
	
	
	
	
title, localeTitle
| title | localeTitle | 
|---|---|
| HTML Method | HTML方法 | 
HTML方法
jQuery .html()方法获取HTML元素的内容或设置HTML元素的内容。
入门
要返回HTML元素的内容,请使用以下语法:
$('selector').html(); 
例如:
$('#example').html(); 
设置
要设置HTML元素的内容,请使用以下语法:
$('selector').html(content); 
例如:
$('p').html('Hello World!'); 
这会将所有<p>元素的内容设置为Hello World!