---
title: "Extjs中给button添加悬浮提示"
author: "txf2004"
date: "2012-12-17T13:57:00Z"
tags: []
slug: "extjs-button"
draft: false
lastmod: "2013-02-02T20:37:50Z"
id: 1783916
url: "https://txf2004.iteye.com/blog/1783916"
---

&lt;html&gt;  
&lt;head&gt;

&lt;!--Put your page Title here --&gt;  
&lt;title&gt;tabPanel Test&lt;/title&gt;  
&lt;!--加载ExtJS --&gt;  
&lt;linkrel="stylesheet"type="text/css"href="extjs/resources/css/ext-all.css"/&gt;  
&lt;scriptsrc="extjs/resources/ext-all.js"&gt;&lt;/script&gt;  
&lt;scriptsrc="extjs/resources/ext-lang-zh\_CN.js"&gt;&lt;/script&gt;  
&lt;/head&gt;

&lt;body&gt;  
&lt;scripttype="text/javascript"&gt;

Ext.onReady(function(){  
Ext.QuickTips.init();

Ext.create('Ext.button.Button', {  
text : 'btn\_tooltip',  
scope : this,  
icon:'resources/images/confirm.png',  
tooltip :'we could see the tooltip for this button',  
handler : function() {  
alert('this is a button')  
},  
renderTo : Ext.getBody()  
});

});  
&lt;/script&gt;  
&lt;/body&gt;  
&lt;/html&gt;

效果图如下：

![](http://img.my.csdn.net/uploads/201212/17/1355724119_1620.jpg)