JQuery :: Wrapping Text With A Span In An Unordered Lists?

Aug 26, 2009

I've got an unordered lists. I need to make the numbers larger (ordered lists numbers) and keep the text in the list at the same size. So what I was assuming I need to do is make the <li> font-size larger (the size I want the unordered list number to be), then wrap the text with a <span> and make the <span> smaller. I'm using a CMS and since the client will be modifying the text in the CMS, I can't exactly tell them to put <span> text, blah, blah</span> in the unordered lists as they won't figure that out. So how would I write the jQuery to wrap the text in the unordered lists with a span? Currently the output is like so:

<ol>
<li>Item One</li>
<li>Item Two</li>
</ol>

[Code]....

View 1 Replies


ADVERTISEMENT

Jquery :: Remove Span Wrapping Input?

Sep 6, 2011

I want to use jquery to make sure that my HTML forms have the correct structure and classes. What I want:

HTML Code:
<form class="myclass">
<label class="label-class"><span class="there_is_supposed_to_be_a_span_here">Label</label>

[code]....

View 1 Replies View Related

JQuery :: Sorting A Nested Loop Of Unordered Lists?

Jan 20, 2011

What I have is a dynamically created group of unordered lists. My jQuery code allows the user to "add" forms that essentially create a new unordered list per form. The first list item is displayed in a heading 2 tag strictly for the style formatting the h2 tag gives.

The user enters data in the forms which are then passed via url.data method to my action page. This is where my code loops(nested loop) through the lists, inserts the appropriate items in either the heading 2 tag or the rest of the list item tags. Then this(these) lists are saved in a temporary file and then called and displayed back by way of an include. The problem is I want these lists to be sorted alphabetically. I have a function that I am close to getting it working, but the problem I think is the fact that I have the special "first" list item within a heading tag.

Here is the function:

var items = [];
$('li').each(function() {
items.push($(this).text());

[code].....

View 2 Replies View Related

JQuery :: Sorting Dynamically Created Unordered Lists?

Jan 17, 2011

I have some code that creates form fields as needed, then the once the user inputs data the values are stored in my action page as an unordered list. The list is then displayed back on my page with an ajax call. All this works fine, but now I wanted and need to have the lists sorted alphabetically. I actually found a thread here and some code someone posted to do this. I thought at first it worked, but it seems to be if'y. Maybe it has to do with the order in which I might add an item to my form. I also wanted to sort by more than the first letter. When I thought, and Im pretty sure it was, working, it seemed it only sorted up to the first letter. Ex:

[Code]...

View 5 Replies View Related

JQuery :: Wrapping Specific Words Inside SPAN Elements?

Jun 12, 2010

Let's say I have this paragraph..<p>My dog is brown.</p I would like to accomplish this.. <p>My <span class="animal">dog</span> is brown.</p> So, I want to use JavaScript to find all "dog" strings inside the paragraph and wrap them in a SPAN element of a given class. I would love to have a plug-in that does that... like this: $("p").findAndWrap("dog", "<span class='animal' />"); I know this can be done in JS, but I'm not particularlyexperiencedin JS string manipulation, so it would take a while until I would accomplish this...Is there a plug-in that does this?

View 7 Replies View Related

Generate Unordered Lists From String Arrays

Nov 14, 2005

I'm having some trouble generating unordered lists from arrays like this

testArray[0] = ["UL1","","SubUL1", "URL"];
testArray[1] = ["UL1","","SubUL1", "URL"];
testArray[2] = ["UL1","","SubUL1", "URL"];
testArray[3] = ["UL2","SubUL1","SubSubUL1", "URL"];
testArray[4] = ["UL2","SubUL1","SubSubUL2", "URL"];
testArray[5] = ["UL2","SubUL2","SubSubUL1", "URL"];

Basically the code should be able generate an unordered list such as,

UL1 SubUL1 (URL) SubUL2 (URL) SubUL3 (URL)
UL2 SubUL1 SubSubUL1 (URL) SubSubUL2 (URL)
SubUL2 SubSubUL1 (URL)

I had to work with the generating codes not the arrays, so the arrays could not be changed to make my job easier.

View 10 Replies View Related

Wrapping Tags Around Selected Text In A Text Area!!

Jun 16, 2006

I'm trying to 'wrap tags' around text in a text box.

<script language=javascript>
function insertFauxTags(fauxTag, e, endFauxTag)
{
var e = document.frmAddNewForum.txtTopicMessage.selected;
document.frmAddNewForum.txtTopicMessage.Value += fauxTag + e + endFauxTag;
}
</script>

And my form:

<form runat="server" id="frmAddNewForum">
<asp:textbox id="txtTopicMessage" runat="server" cssclass="formtext" rows="5" textmode="MultiLine" width="95%" style="width:95%"></asp:textbox>
</form>

And here's how I'm calling the function:

<a href="javascript:insertFauxTags('[p]' + e + '[/p]')"><img src="http://www.<%=strSiteName%>/images/parabutton.gif" border="0" alt="Paragraph" /></a>
When I run this in FF I get 'e' is not defined - any ideas?

View 1 Replies View Related

Wrapping A Selection With Text?

Jun 11, 2011

I am working on code to wrap BBCodes around a user selection, then leave the selection selected for possibly adding more BBCodes around the same selection.My problem is that there seems to be several different ways to do it and I can't figure out which one is "the best".Now, I can't use the "standard" way of doing this because I am working with TinyMCE. I know there are countless examples on how to do this with textareas... that is NOT what I need.TinyMCE can give me a selection RANGE, a selection NODE or a selection OBJECT. Note that if I use TinyMCE's range, it internally "normalizes" the range to be a standard W3C range, regardless of browser.I've created a new range, extracted the selection from the user's range, created elements for the open and close BBCode, inserted the elements into the range and finally set the user's selection to the new range. Works fine.

I also tried taking the selection node (which is an element), then simply used "innerHTML" to add the opening and closing tags, then set the node to the modified node. Works fine.I've also used the editor's built in "selection.getContent()" and "selection.setContent()" calls and THIS also works.I've even tried using the DOM "surroundContents()" function, then used a regex to change the < and > into [ and ]. Freaky... but that works too.So, my dilemma is... which method should I use???To recap, here's what I want (blue represents selected text):

This is a test sentence. (user selected some text)
This is a test sentence. (text is wrapped and remains selected).
This is a test sentence. (user clicked another bbcode button).

[code]....

View 6 Replies View Related

Wrapping Selected Text With Some Tag?

Oct 13, 2011

I found this code on some web site which actually works on my current Safari browser. I will be grateful if anyone out there with IE version 8 or less can verify it working as well.

Basically I wanted to highlight some text with mouse drag, and have that piece of text wrapped with [high] at the beginning and [/high] at the end.

[Code]...

View 1 Replies View Related

Wrapping Text In Table Of Contents?

Sep 7, 2011

I am building an e-learning lesson in Lectora that will be deployed to a SCROM compatible learning management system. The lesson is converted into HTML before that happens. My table of contents is around 100 pixels wide but some of the page names are longer than that and do not display fully when viewed in a browser.What I am trying to do is this:The page name for this page is very, very long and I can't see it all. Blah blahWould becomeThe page name for this page is very,

View 1 Replies View Related

Wrapping Tags Around Selected Text

May 2, 2007

I've got a form with a textarea box, currently you can just type a message in the box and submit it, then it is added to a mysql database and shows up on a page I made for people to view staff memos.

I've been asked to add formatting options like bold, italic, underline etc. Unfortunately me and javascript have never really met so I'm quite stumped. I can handle the form processing with PHP converting [b] to <strong> etc myself but I need help with the actual user interface.

View 1 Replies View Related

JQuery :: Find Node Text - Making A Variable Equal The H1 Html() Without The Span Text

Nov 16, 2009

<h1>November<span>2009</span></h1>

making a variable equal the h1 html() without the span text.

// equals 'November2009'
var monthDelete = $('h1').html();
// I need just 'November'

View 1 Replies View Related

JQuery :: Splitting Text - Truncate Some Text Within A 'span' In Order To Create A 'more/less' Button To Show/hide The Additional

Mar 18, 2011

I am trying to truncate some text within a 'span' in order to create a 'more/less' button to show/hide the additional. I effectively want to turn this:

[Code]...

View 1 Replies View Related

Unordered List Within A Text Box?

Oct 13, 2011

I've recently seen the following web app and I'm curious as to how they've been able to put items within the 'To' textbox. If you type a random name in the 'To' box and press enter it adds that as an item and then allows you to add more or even remove what's already there.

How have they done this and is there a name for this?

View 1 Replies View Related

JQuery :: $('<span>').text('new Text') Not Working In IE

Aug 5, 2010

Has anyone seen this before..

var myText = 'blah';
$('<span>').text(myText);

The above correctly sets the text of the span to blah in all browsers except IE. The only way I've gotten it to work in IE is...

$('<span>' + myText + '</span>')

Not the worst hack, but all the extra typing is adding up.

View 5 Replies View Related

JQuery :: Add Text Into A <span>?

May 11, 2010

I have this script who will set a text to an existing or newly created <span>. When I executed the script, I can see ths <span> element to the source but the text never appear. Here is the last version of this script (the alert box is displayed but the "_message" is never dispalyed to the page):

var _message = response[inputId];
var $field = $(jqn('#'+inputId));
var $span = $(jqn('#'+inputId+'.errors'));

[Code]...

View 4 Replies View Related

JQuery :: Get Html/text From A Span?

Dec 28, 2011

some how i don't get the inner text of the span

[Code]...

View 4 Replies View Related

JQuery :: Span Text Change Event?

Aug 24, 2009

How can I catch an event when text in span is changed ?

$("span").change(...

doesnt work :/

View 2 Replies View Related

Jquery :: Script To Extract Text From LI - Span Also Selected?

Mar 15, 2010

I currently have a script that extracts the text from an li using:
$('li').text();
simply enough.
But I have span within the li, and the text within the span is also being selected. Is there a way to remove the span text from the selection?

View 4 Replies View Related

JQuery :: Finding A Span Nested Inside Another Span?

Sep 13, 2011

If you have span within another span, jQuery selector seems to be unable to find it.example:

<span
>
<span

[code]....

View 2 Replies View Related

JQuery :: Select Span With Span Parent?

Aug 31, 2009

How would I select all spans which have a span as a parent?

View 2 Replies View Related

Getting Text From A Span

May 12, 2010

I'm working on a project with span's and event handlers.Basically what I need to do is be able to get the text from within a span when the user mouses over.I know how to set up the event handlers, that's all working fine, my issue is the actual extraction of the text. I've tried using .nodeValue and .TEXT_NODE but these keep coming back null.So is there a way to do something like: var text = document.etElementById ("example"). nodeText;and get a string of text?

View 9 Replies View Related

Cell Text In A Span?

May 11, 2010

In the following table segment, I have been trying to use DOM techniques to get the text values.For example in this line: (<span id="edit5_oname" >BOBBY</span>), I only want to get BOBBY. What's happing is if I use alert(x[2].innerHTML); it returns <span id="edit5_ownerid">8</span>.I have tryed various techniques like:

alert(x[2].data);
alert(x[2].innerHTML);
alert(x[2].firstChild.nodeValue);

[code]....

View 3 Replies View Related

Replace Text Of A Document Span?

Feb 15, 2012

I have developed an website with drupal 7.10. I want this should be in bengali language. everything is ok but problem with numerical system. for example: date,time,points etc.

Now I have decided to add java code at the bottom of the theme. so that after loading the page javascript with replace those text. This replacement should be limited to some span not in all document.

I have this as below code in the document

<span class="submitted">, 12/20/2011 - 07:10 <a class="username" title="" href="/user/4">afshalur</a></span>

View 1 Replies View Related

Text Field Contents To Span

Nov 7, 2009

The user enters the title of a movie in the text field. I'd like to mirror that title into a <span> so that users can search other sites based upon that title, gather the information and then put it into the current form on my site.

Code:
<input type="text" name="title" value="" />
<a href="abc.com?title=<span>TEXT FIELD VALUE HERE</span>">search abc.com for this title</a>

View 3 Replies View Related

Check Length Of Text In HTML Span Tag?

Sep 18, 2010

I was just wondering how I could do this...

I currently have this

<span id="span_1">Title</span>

What I want to know is if the span is something like 240px in width how can I make it so if the text inside the span tag is to long and puts the text onto a second line how can i make a cut off point in the text to stop the text moving to a new line and adding '...' if the text is to long??

View 1 Replies View Related







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