Custom Tags And Elements

Dec 5, 2006

I would like to include extra "hidden" information in a generated HTML page
that can be used by javascript functions.

I realise that most browsers seem to ignore any tags and attributes they
don't understand, but from what I can tell the standards do not allow me to
make up my own tags or attributes as they will fail validation.

is there any standard element name that can be used for such a purpose i.e.
passes validation but never produces any output (and ideally allows nested
elements to be rendered normally too)...

View 10 Replies


ADVERTISEMENT

JQuery :: Adding Custom Attribute Tags To HTML Elements

Apr 14, 2010

Here's what I'm trying to do:
1) I get reference to a div that's on my page:
var theDiv = $("#" + divID);
2) Now I want to add a custom attribute tag to it, so for instance I want to add "winWidth" so that the div object now contains "winWidth=" for instance.
3) I want to set winWidth now since it's part of theDiv to a value

I'm not sure how to really do 1 + 2. I need to do this on the fly because some javascript logic later will add these attributes dynamically to the div... outside of what the original div had...I don't care what it had, I know I have it now in a JS variable and now I want to both add some new attributes to the div, and then set them on the fly. I don't need these attributes to be on my page, I just need them added to my div variable reference.

View 3 Replies View Related

Custom Tags With ExecCommand

Jul 20, 2005

Does anyone know of a way to wrap custom tags around selected text
using execCommand or otherwise?

I am developing a rich text editor for use in a web site and while
there are a few decent ones already floating around I need to
implement a few extra bits of functionality. Specifically tool tips.
Idealy I'd like to wrap custom tags around selected text using
execCommand. Ie "Selected Text" becomes:

"<a title='User inputed tooltip'>Selected Text</a>".

Any ideas?

View 1 Replies View Related

Any Way To Replace Custom Tags To Spans?

Oct 24, 2011

I need to replace custom tags to spans. I have:
Code:
<block style="color:blue" class="block01" limit="100">This is a block</block>
I need to fetch the attributes and add them to a span, like:
Code:
<span style="color:blue" class="block01" limit="100">This is a block</span>
There's a few on the page so I need to change all of them some may have many attributes.

View 1 Replies View Related

JQuery :: Selector With Custom Namespace Tags

Dec 9, 2009

I need to get a reference to a tag with a custom namespace, e.g.: <foo:MyTag/>. I've tried $("foo:MyTag") but that doesn't seem to work.

View 5 Replies View Related

Use Custom Tags In Html And Render Data Based On Their Use

Sep 10, 2010

I am trying to find how to use custom tags in html and render data based on their use.

A good example is the joomla <jm:whatever> tag.

I found the following article: [url]

I think it might be outdated though because the behavior:url element does not seem to work. Plus, when I check the style sheet on a joomla site, it doesnt seem to use this method. I think these tags might be xml but I do not know how to render them based on the tag.

For example: <customAbbrv:display src="test.html" label="Test" />

I would want this tag to fire test.html and pass the attribute label which is set to Test.

View 2 Replies View Related

Null Object Error - Custom Form Elements Script

Dec 16, 2009

I am using a custom form elements script in the link below:

And an error for null object is appearing from this line:

Got this script working perfectly on my local machine - once I loaded it the live site it didn't work...

View 2 Replies View Related

Loop Through Form.elements Array Validating With Custom Event Handlers?

Jun 27, 2011

Nice module, but I can't get it too work.

Code:

/**
* validate.js: unobtrusive HTML form validation.
*

[code]....

but the script alerts me nothing?

View 6 Replies View Related

JQuery :: Wrap <a> Tags Around Text In <li> Elements - Get The Index Of The <li> In The <ul>?

Feb 3, 2010

I am trying to wrap <a> tags around text in <li> elements. How can I get the index of the <li> in the <ul>? I tried something like this: $('.tabbed-list li').wrapInner('<a></a>'); That works fine. However, I want to do something like this: $(this).wrapInner('<a href="#' + $(this).index() + '"></a>');

View 1 Replies View Related

JQuery :: Getting Html From TD By Chaining Elements With Tags And IDs Within Scope

Jan 21, 2010

I've been programming in jQuery for some time now, and for the first time, I came across an issue where I am writing out the location of a TD with an ID="step" to get the innerHTML with html(). I receive a null value, but when I use td:first within the chain of elements, it works.Has anyone experienced this issue or have any idea why this is not working? I've tried other TDs with diffirent IDs within the same row, and the same null result happens.Is there a possible limitation to the numbe of IDs used within the chaining of the $() call?

View 4 Replies View Related

JQuery :: Iterate Through Table Get Tags/elements And Their Values In Each Row?

Jun 17, 2011

I have now been playing around for hours trying to figure this out. Swore I would not ask for a solution. Now I have a headache, so I am asking. On one HTML Page (From.htm) I have:

[Code]...

I somehow, need to get the values as shown in the handle function for each of Products shown in From.htm. Keep in mind the only thing I know from From.htm is the class names. I have no idea what products are listed or what the input names are. This table is generated by a third party. Assume that index.htm and From.htm are on the same website.

View 2 Replies View Related

JQuery :: Unable To Get Toggle Effect Working Having Different Div Tags And Different <a> Tags

Dec 15, 2011

Can't seem to make it work, I have seen many examples but they are all just for 1 div tag. When i trymore than one it doesn't work anymore.The first one works, if i have more than 1 then the other don't work.

using the following jquery
$(document).ready(function(){
$("#toggle-text").click(function () {
var divvalue= this.value;

[Code]....

View 1 Replies View Related

Firefox - Select A Word And Wrap [b] Tags Or [quote] Tags Around It

Dec 28, 2010

I use Firefox and am wondering how to select a word and wrap [b] tags or [quote] tags around it?

View 30 Replies View Related

Input Tags Outside Form Tags ?

Jul 12, 2010

Is it possible to trigger the action of a form with a submit button that's outside the form tags? If so, how should this example be rescripted to make the input tag work outside the form tags?

View 3 Replies View Related

Find <a> Tags With <img> Tags In Them?

Jun 25, 2010

I really know nothing about how to code JavaScript (I know what it is and what it does) and I need a script to go in the head of my page and look for all <a> tags that have <img> tags inside of them and add a rel="lightbox" attribute to them.

View 6 Replies View Related

JQuery :: Show / Hide Elements Or Remove / Add Elements Based On Radio Selection By User?

Mar 14, 2010

I have a page I am working and I am having some trouble with: I need to show and hide areas based on a radio selection. I initally started using the show / hide feature in Jquery but the problem is the elements need to be removed but then put back if the user selects the radio buttonagain as it has form elements that have validaion on them. The validation is still trying to validate the form elements becuase they are still on the page but just not showing. This is the radio group the user makes the selection from:

<input name="terms_usr" type="radio" id="terms_usr_1" value="1"/>
<label for="terms_usr_1">Credit Card</label>
<input type="radio" name="terms_usr" id="terms_usr_2" value="2"/>
<label for="terms_usr_2">C.O.D</label>

[Code]....

View 3 Replies View Related

Converting HTML Elements Stored Within XML To Usage Js Elements?

Jun 3, 2010

I have HTML tags stored in XML. I want to be able to use these HTML elements with Javascript, just as you can with elements in document.body. How can it be done? (And don't try and tell me I should use server-side because I have written it all for Javascript and the project is nearly complete minus this and there are practical reasons for not doing this server-side. After all, anything is possible with Javascript!)

Let me explain:

- I have HTML templates such as this [URL]

- I want javascript to populate these templates then add them to my page

- The only way I know javascript can get this kind of data is by parsing XML

- I want to parse the XML then be able to use the HTML elements just like those in document.body

- As far as I'm aware, XML is the only good way of storing data for javascript. I don't want to store it in javascript variables (too much multiline data with " and '). Nor do I want to build it using document.createElement("div")... etc

As someone not yet with any experience in computer science etc, please ignore my poor terminology! However, I'm not a beginner when it comes to javascript.

Here's the script concerned but I doubt it'll help you understand my problem: [URL]

View 6 Replies View Related

.live() Working On New Elements But Not Existing Elements?

May 24, 2010

So i've got a form that adds an element onto the page. This is working. When I try to remove said elements, that works. But the same 'delete' button doesn't work on elements not generated by javascript.

Code JavaScript:
function destroyQuickTask() {
$.post($(this).attr("href"), null, null, "script");

[code]....

View 6 Replies View Related

Custom Function

Mar 25, 2006

I have created a function.

function unHide (fieldname)
{
.... not important...
document.form1.fieldname.style.visibility = 'visible'

}

I have a field name called country in a form.
When the onclick="unHide('country')" is used then the above function
does not work
but if i change the following line within the function
document.form1.country.style.visibility = 'visible' then it works.

What am i doing wrong.

View 5 Replies View Related

Resolved Custom Pop Up Box

Aug 8, 2010

I am looking for a custom pop up box, but there is only 3 kinds (Alert, Confirm, Prompt). Neither of those will work.

View 13 Replies View Related

Custom Alert Box

May 9, 2007

I've tested it in most recent versions of IE, FF, Opera, and Safari.

The first parameter is the alert's text, if a second parameter is passed, it is the alert's title, else it will just have "Alert" in the title.

You can fire the function as many times as you like, any alert's thrown after the first will set themselves on top of each other slightly staggered much like the built in alert.

The alert will automatically be placed in a visible place regardless of where the page has scrolled. They will also stay in that same place in relation to the screen if the user scrolls after the alert has fired.

The top most alert is the only one clickable and moveable until it has been acknowledged (Much like a regular alert).

The benefit of this is that it does not freeze the user's interface once the alert is thrown.

Here's the code:

Javascript:

//*****************************
// Custom Alert Box
// Free to use with credits in tact.
// Written By Adam Matthews aka Basscyst
//AdamDMatthews@Gmail.com
//*****************************
function msgBox(msg,hdr){
if(!document.getElementById('alerts')){
var div=document.createElement('div');
div.setAttribute('id','alerts');
document.body.appendChild(div);
}
var div=document.createElement('div');
div.className="alertbox";
var h3=document.createElement('h3');
h3.className="alerttitle";
var p=document.createElement('p');
p.className="alerttxt";
var footdiv=document.createElement('p');
footdiv.className="alertfoot";
div.appendChild(h3);
div.appendChild(p);
div.appendChild(footdiv);
var but=document.createElement('input');
but.setAttribute('type','button');
but.className='alertbut'
but.setAttribute('value','OK');
footdiv.appendChild(but);
var hdr=(hdr) ? hdr : "Alert!";
h3.appendChild(document.createTextNode(hdr));
var cut=msg.split("
");
var len=cut.length;
p.appendChild(document.createTextNode(cut[0]));
for(var i=1;i<len;i++){
p.appendChild(document.createElement('br'));
p.appendChild(document.createTextNode(cut[i]));
}
document.getElementById('alerts').appendChild(div);
window.onscroll=function(){
placeAlerts();
}
window.onresize=function(){
placeAlerts();
}
placeAlerts();
}
var posX;
var posY;
function mouseXY(e){
if (!e){
var e = window.event;
}
if (e.clientX)
{
posX = e.clientX + document.documentElement.scrollLeft;
posY = e.clientY + document.documentElement.scrollTop;
}
else
{
posX = Math.max(e.pageX,0);
posY = Math.max(e.pageY,0);
}
var coord=new Array();
return coord;
}
if(document.captureEvents){
document.captureEvents(Event.MOUSEMOVE)
}
function placeAlerts(){
var alerts=document.getElementById('alerts').getElementsByTagName('div');
var len=alerts.length;
var x=0;
var y=300;
var w=document.body.clientWidth;
var h=document.body.clientHeight;
for(var i=0;i<len;i++){
alerts[i].style.zIndex=i+100;
alerts[i].getElementsByTagName('h3')[0].onmousedown="";
alerts[i].getElementsByTagName('input')[0].onclick="";

if(window.pageYOffset){
alerts[i].style.top=y+(window.pageYOffset)+'px'
}else{
alerts[i].style.top=y+(document.documentElement.scrollTop)+'px'
}
alerts[i].style.left=(w / 2)- (343 / 2) + x +'px';
x=x+15;
y=y+15;
if(i==len-1){
var h3=alerts[i].getElementsByTagName('h3')[0];
var but=alerts[i].getElementsByTagName('input')[0];
but.onclick=function(){
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
var alerts=document.getElementById('alerts').getElementsByTagName('div');
if(alerts.length==0){
window.onscroll="";
}
placeAlerts();
}
h3.onmousedown=function(event){
this.parentNode.setAttribute('id','active_alert');
var event=(event)?event:arguments[0];
mouseXY(event);
start_x=posX;
start_left=document.getElementById('active_alert').style.left.replace('px','');
adjust=posX-start_left;
document.onmousemove=function(event){
var event=(event)?event:arguments[0];
mouseXY(event);
var obj=document.getElementById('active_alert');
obj.style.left=posX-adjust+'px'
obj.style.top=posY-5+'px'
};
}
h3.onmouseup=function(){
document.onmousemove="";
this.parentNode.setAttribute('id','');
}
}
}
}

Function Call

msgBox("You have done something real bad!
So Bad, oh so bad!","Ya shoudn't of done it boy!")


CSS

.alertbox{
width:344px;
position:absolute;
padding:0px;
margin:0px;
border:solid 1px #FFFFFF;
}
.alerttitle{
background-color:#9B1317;
color:#FFFFFF;
font-size:12px;
width:344px;
cursor:pointer;
text-align:center;
margin:0px;
padding:0px;
}
.alerttxt{
background-color:#E7EFF7;
margin:0px;
font-size:11px;
text-align:center;
padding:0px;
width:344px;
}
.alertfoot{
background-color:#9B1317;
text-align:center;
width:344px;
margin:0px;
padding:0px;
}
.alertbut{
margin-top:2px;
cursor:pointer;
}

View 3 Replies View Related

How Can We Get ChildNodes From A Custom Tag?

Dec 26, 2003

i wrote a very simple HTML page to test some DOM features between Mozilla and IE. Mozilla is perfect everything went fine and i got the childNodes from my custom tag ( this tag i named <blah> ), inside this tag there is two <span>, that i retrieved. But with IE i really could figure out how its done! Code:

View 1 Replies View Related

Setting Custom Properties

Jul 23, 2005

I know that I can read/write custom properties of an object by using
the following:

Setting:
document.all['Control'].customProp = "this";
Getting:
document.all['Control'].customProp;

Is there a way I can run code when this custom property is set. Or
perhaps there is a way to create a custom method?

Example:
<span id="MySpan"><input type="text"></span>

I'd the property:
document.all['MySpan'].enabled = true;
To automatically do this:
document.all['MySpan'].controls[0].disabled = !thevalue;

OR the method
document.all['MySpan'].enable();
To do this:
document.all['MySpan'].disabled = false;

View 5 Replies View Related

Custom Properties On DOM Nodes

Jul 23, 2005

I try to associate DOM nodes with other objects. Assigning custom
properties to DOM nodes works in Firefox and Safari. It also works with
HTML nodes in IE6. However, it appears not to work with XML nodes that
are part of trees returned by XMLHttpRequest. How can I work around this
limitation? For XML nodes, I need to be able to associate at most one
object with each node.

The syntax I am using is
node.customproperty = value

View 2 Replies View Related

AppendChild Custom HTML Tag For IE

Nov 23, 2005

I have a custom HTML tag: <custom>text is here</custom>

I can do anything I would like in terms of calling methods with mozilla
but not IE 6. For instance calling appendChild in IE results in an
error. The innerHTML property is blank even though there is text
between the tag.

Is there a work around for IE. What gives with IE and being able to
access and manipulate custom tags??

View 1 Replies View Related

Custom Hiliting Button...

Jul 20, 2005

I want to have a custom button change appearance when pressed and then
call a function and change back to its original appearance when released.

here's what i have now, which works mostly. "drop" is my handler for the
button, its argument tells me which button was pressed. i have a number
of these buttons and they are organized in a table.

there is a fair amount of superstition here, the result of many tiny
experiments i ended up with this which seems to work best: Code:

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved