---
title: "Cognos  HTML项目代码 "
author: "18289753290"
date: "2015-08-08T22:28:39Z"
tags: []
slug: "cognos-html"
draft: false
lastmod: "2015-08-08T22:28:39Z"
id: 2233806
url: "https://xiaoyaya751.iteye.com/blog/2233806"
---

使用“HTML项目”组件可以去除下拉列表中的“-------------------”，基本上是用在有下拉列表的地方.

&lt;script type="text/javascript"&gt;

var form = getFormWarpRequest();

var listB = form.\_oLstChoicesp\_month;

listB.options\[0].text = "统计日期";

listB.remove(1);//不选“--------”

listB.removeAttribute(0);//不选参数

listB.removeAttribute("hasLabel");//默认值不选

&lt;/script&gt;